Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_img_math.rbが環境によってエラー #1662

Closed
kmuto opened this issue Feb 8, 2021 · 2 comments
Closed

test_img_math.rbが環境によってエラー #1662

kmuto opened this issue Feb 8, 2021 · 2 comments

Comments

@kmuto
Copy link
Owner

kmuto commented Feb 8, 2021

test_img_math.rb が手元だと結果がおかしい…。何か環境依存になってしまうものがありそう。

Failure: test_defer_math_image(ImgMathTest)
/home/kmuto/review/test/test_img_math.rb:50:in `test_defer_math_image'
     47:     assert File.exist?(img_path2)
     48: 
     49:     val1 = compare_images(img_path1, File.join(assets_dir, 'img_math/img1.png'))
  => 50:     assert_equal 0, val1
     51: 
     52:     val2 = compare_images(img_path2, File.join(assets_dir, 'img_math/img2.png'))
     53:     assert_equal 0, val2
<0> expected but was
<303>

diff:
? 303
================================================================================
.F
================================================================================
Failure: test_make_math_image(ImgMathTest)
/home/kmuto/review/test/test_img_math.rb:84:in `test_make_math_image'
     81:     assert File.exist?(img_path1)
     82: 
     83:     val1 = compare_images(img_path1, File.join(assets_dir, 'img_math/img3.png'))
  => 84:     assert_equal 0, val1
     85:   end
     86: 
     87:   private
<0> expected but was
<6>
@takahashim
Copy link
Collaborator

後者の方は < 20とかで比較してもいいと思いますが、前者の方はだいぶ差がありそうですね…。
フォントが違うとかでしょうか。

@kmuto
Copy link
Owner Author

kmuto commented Feb 13, 2021

ぱっと見でフォントは同じ、画像サイズも同じなんですが、TeXLiveバージョンによって輪郭に違いが生じるみたいです。手元ビルドで生成されたimg1,img2相当ファイルを添付します。

#1668 でcompareにファジーパラメータを付けてみました。これだと手元でもActionsでも違いを吸収でき、またimg1とimg2の差異も検出できています。

_gen_550bf9e762fb11144bc332fbac7a08daa4f7a6b40026ba50f27e54a5d9dd316d
_gen_d8949a450cca0d7479a4cb89d402197463b517190cef11fd31a2b15ecc8eb66d

kmuto added a commit that referenced this issue Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants