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

Support png images #329

Merged
merged 6 commits into from
Aug 13, 2022
Merged

Support png images #329

merged 6 commits into from
Aug 13, 2022

Conversation

leque
Copy link
Contributor

@leque leque commented Jul 23, 2022

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):
image

@gfngfn
Copy link
Owner

gfngfn commented Aug 8, 2022

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:

@leque
Copy link
Contributor Author

leque commented Aug 8, 2022

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.

@gfngfn
Copy link
Owner

gfngfn commented Aug 13, 2022

Thank you for explanation. I understand.

I will merge this PR. Again, thank you so much for the development!

@gfngfn gfngfn merged commit 829abcb into gfngfn:master Aug 13, 2022
@leque leque deleted the support-png branch August 13, 2022 14:36
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

Successfully merging this pull request may close these issues.

2 participants