SATySFi
SATySFi copied to clipboard
Support png images
This PR adds PNG images support. Supported PNG formats are monochrome, grayscale, rgb, and 4/8 bit colormap (1/2 bit colormap and alpha-channel are not supported).
Supported formats are summarized as below (full lists can be built from tests/images/test.saty
):
Thank you so much for the enhancement!
I confirmed that it indeed works as to output PDF files. A slight warning message was shown, however:
$ cd tests/images/
$ satysfi test.saty
(omitted)
---- ---- ---- ----
evaluating texts ...
[Warning] (satysfi-logo-cmyk.jpg) Jpeg images with CMYK color mode are not fully supported.
Please convert the image to a jpeg image with YCbCr (RGB) color model.
[Warning] (peppers-cmyk.jpg) Jpeg images with CMYK color mode are not fully supported.
Please convert the image to a jpeg image with YCbCr (RGB) color model.
evaluation done.
---- ---- ---- ----
breaking contents into pages ...
needs another trial for solving cross references...
---- ---- ---- ----
evaluating texts (2nd trial) ...
[Warning] (satysfi-logo-cmyk.jpg) Jpeg images with CMYK color mode are not fully supported.
Please convert the image to a jpeg image with YCbCr (RGB) color model.
[Warning] (peppers-cmyk.jpg) Jpeg images with CMYK color mode are not fully supported.
Please convert the image to a jpeg image with YCbCr (RGB) color model.
evaluation done.
---- ---- ---- ----
breaking contents into pages ...
all cross references were solved.
---- ---- ---- ----
embedding fonts ...
libpng warning: Interlace handling should be turned on when using png_read_image
---- ---- ---- ----
writing pages ...
---- ---- ---- ----
output written on 'test.pdf'.
Is the occurrence of the message libpng warning: Interlace handling should be turned on when using png_read_image
expected? Probably this is not harmful, according to the following discussion, for example:
- https://stackoverflow.com/questions/12990602/libpng-warning-interlace-handling-should-be-turned-on-when-using-png-read-image
Ah, I noticed this message. It is emitted only for interlaced images (in this case, basi0g01.png).
If we use only non-interlaced pngs, we do not see this message. I think this behavior is not so harmful.
Thank you for explanation. I understand.
I will merge this PR. Again, thank you so much for the development!