Also replace mask file extension to .png instead of appending#3611
Also replace mask file extension to .png instead of appending#3611
Conversation
|
Is there any reason against merging this feature? |
|
Thanks and apologies for not looking at this earlier. I am surprised this doesn't already work and left a comment for you. If it's not already covered by a test, we should add a unit test to image_reader_test.cc to cover this new behavior. Thank you. |
Checking mask path for appending and replacing image_name extension
|
This wasn't discovered because the test is only testing for
When running the test on my machine I get the following error, not sure if it's relevant Let me know if you need any changes, I don't have a lot of experience writing tests |
Co-authored-by: Johannes Schönberger <jsch@demuc.de>
Head branch was pushed to by a user without write access
|
The test fails due to jpg compression being lossy as far as I can tell, how should we handle it? |
|
You could use another lossess image format like bmp instead of jpg or cross fingers that explicitly setting a jpeg quality of 100 through the "flags" parameter in Bitmap::Write() makes the roundtrip lossess. |
|
Thank you! |
Sometimes the input images are a mix of .png and other extensions.
To handle the mask filenames, which are always .png, it is cleaner to replace the image extension instead of appending.
This would avoid filenames such as filename.jpg.png and filename.png.png
Change:
If checking fails for appending .png to the mask path, I also check by replacing the file extension by .png.