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

Image with exif orientation tag #2316

Open
tarrant17 opened this issue Aug 18, 2021 · 3 comments
Open

Image with exif orientation tag #2316

tarrant17 opened this issue Aug 18, 2021 · 3 comments

Comments

@tarrant17
Copy link

Hi everybody,

It seems that PdfMake is ignoring the exif metadata tag "orientation". I dont know if its a bug or a feature not implemented.

I tested with two image with different "orientation" tag. One set to "Horizontal normal" and other with "90° CW". Both images are displayed in landscape style.

I made a sandbox project to reproduce :

https://codesandbox.io/s/pdfmake-forked-nzdm6?file=/src/index.js

Thanks for your reply and sorry for my english

@liborm85 liborm85 added the image label Sep 29, 2021
@liborm85
Copy link
Collaborator

EXIF metadata is not supported by pdfkit.

(related pdfkit issue foliojs/pdfkit#626)

@capc0
Copy link

capc0 commented Nov 6, 2024

With pdfmake version 0.2.15 which updated pdfkit to 0.15.1, the logic of ignoreOrientation of https://github.com/foliojs/pdfkit/blob/master/docs/images.md has landed in pdfmake.

I have tested this with the landscape example images of https://github.com/ianare/exif-samples/tree/master/jpg/orientation.
Previously 7 out of the 8 test images where rotated, flipped and/or inverted in some way. With the new version all 8 images are rotated correctly. The only issue is that 4 of the images are stretched. This might be due to the fit: [width, height] logic. But I guess this is again a bug in pdfkit.

pdfmake@0.2.7

image

pdfmake@0.2.15

image

Nevertheless, the new version drastically improves EXIF support already!

@liborm85
Copy link
Collaborator

liborm85 commented Nov 6, 2024

pdkit returns the original dimensions of image and in rendering swap dimensions according to the orientation. pdfmake ignores this behavior.

Fixed by commit 9052559.

New output:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants