From 73f06a3fa087af164c54b57b2d92466d689d107e Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 22 Jul 2021 18:11:46 -0400 Subject: Fix definition image aspect ratio issue (#1847) * Fix incorrect aspect ratio * Update test data --- test/data/dictionaries/valid-dictionary1/character2.gif | Bin 0 -> 68 bytes test/data/dictionaries/valid-dictionary1/character3.gif | Bin 0 -> 70 bytes test/data/dictionaries/valid-dictionary1/term_bank_1.json | 11 +++++++++++ test/test-database.js | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test/data/dictionaries/valid-dictionary1/character2.gif create mode 100644 test/data/dictionaries/valid-dictionary1/character3.gif (limited to 'test') diff --git a/test/data/dictionaries/valid-dictionary1/character2.gif b/test/data/dictionaries/valid-dictionary1/character2.gif new file mode 100644 index 00000000..8f7d000a Binary files /dev/null and b/test/data/dictionaries/valid-dictionary1/character2.gif differ diff --git a/test/data/dictionaries/valid-dictionary1/character3.gif b/test/data/dictionaries/valid-dictionary1/character3.gif new file mode 100644 index 00000000..e6032832 Binary files /dev/null and b/test/data/dictionaries/valid-dictionary1/character3.gif differ diff --git a/test/data/dictionaries/valid-dictionary1/term_bank_1.json b/test/data/dictionaries/valid-dictionary1/term_bank_1.json index 1d75f597..8f2a4c42 100644 --- a/test/data/dictionaries/valid-dictionary1/term_bank_1.json +++ b/test/data/dictionaries/valid-dictionary1/term_bank_1.json @@ -65,6 +65,17 @@ {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "crisp-edges", "background": false, "appearance": "monochrome", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, "莢\n" ]}, + {"type": "structured-content", "content": [ + "Imgae aspect ratio tests:\nあ", + {"tag": "img", "path": "character2.gif", "height": 1.1, "imageRendering": "crisp-edges", "appearance": "monochrome", "background": false, "sizeUnits": "em", "collapsed": false, "collapsible": false}, + "あ\nあ", + {"tag": "img", "path": "character2.gif", "width": 0.4125, "imageRendering": "crisp-edges", "appearance": "monochrome", "background": false, "sizeUnits": "em", "collapsed": false, "collapsible": false}, + "あ\nあ", + {"tag": "img", "path": "character3.gif", "width": 1.1, "imageRendering": "crisp-edges", "appearance": "monochrome", "background": false, "sizeUnits": "em", "collapsed": false, "collapsible": false}, + "あ\nあ", + {"tag": "img", "path": "character3.gif", "height": 0.4125, "imageRendering": "crisp-edges", "appearance": "monochrome", "background": false, "sizeUnits": "em", "collapsed": false, "collapsible": false}, + "あ" + ]}, {"type": "structured-content", "content": [ {"tag": "div", "style": {"fontStyle": "normal"}, "content": "fontStyle:normal"}, {"tag": "div", "style": {"fontStyle": "italic"}, "content": "fontStyle:italic"}, diff --git a/test/test-database.js b/test/test-database.js index f8b93505..f2a7efdd 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -162,8 +162,8 @@ async function testDatabase1() { true ); vm.assert.deepStrictEqual(counts, { - counts: [{kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 2}], - total: {kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 2} + counts: [{kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 4}], + total: {kanji: 2, kanjiMeta: 2, terms: 20, termMeta: 16, tagMeta: 15, media: 4} }); // Test find* functions -- cgit v1.2.3