parallax/jsPDF

some images are auto-rotated when I use addImage function

tj327 opened this issue · 5 comments

tj327 commented

Some of my images are automatically rotated when I call addImage function.
Here are the screenshots.
First one shows the auto-rotated image and second one is the original image.
Screen Shot 2020-07-16 at 2 26 23 PM
1593381195777-IMG_20200611_093336790_HDR

I tried to pass rotation param as 0 but it didn't work.
Here is the code snippet that I used.
this.doc.addImage(photo.base64, 'jpeg', 40, 40, 100, 150);
Why is this image auto-rotated?
Any help, plz.

most likely the same issue as #2740. please check the image EXIF metadata.

tj327 commented

So jsPDF doesn't work with auto-orientation of the image's EXIF metadata?
When will this feature be available on the jsPDF library?

I checked your image's EXIF data and the Resolution is 2268 x 4032. So it's not that. Maybe you'll need to show more code. I don't have the same problem.
image

` function useHtml() {
let pdf = new jsPDF('p', 'pt', 'a4');
let margin = 18; // narrow margin - 1.27 cm (36)

    pdf.setProperties({
        title: 'pdf'
    });

    pdf.html(document.getElementById('test'), {
        filename: 'pdf',
        html2canvas: {
            // backgroundColor: '#fdf5e8',
            // scale: scale // default is window.devicePixelRatio,
        },
        x: margin,
        y: margin,
        callback: function () {
            // pdf.save('test.pdf');
            window.open(pdf.output('bloburl')); // to debug
        }
    });
}`

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.