Bug 347572 - imported photoshop-created jpg images fail to read dpi correctly
Summary: imported photoshop-created jpg images fail to read dpi correctly
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (other bugs)
Version First Reported In: unspecified
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-11 20:31 UTC by Daniel Cohen
Modified: 2015-05-15 10:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
example of jpg (85.64 KB, image/jpeg)
2015-05-11 20:32 UTC, Daniel Cohen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Cohen 2015-05-11 20:31:32 UTC
If you take a jpg image saved in photoshop at any dpi other than 72, when opened with krita, it interprets it as 72dpi.

Reproducible: Always

Steps to Reproduce:
1. save 300dpi jpg in photoshop
2. load jpg into krita

Actual Results:  
Krita fails to identify the correct DPI of 300

Expected Results:  
It should load the image with 300 DPI

Resaving the jpg in irfanview solved the issue, presumably down to some embedded info changing type although I'm not sure what exactly.
Comment 1 Daniel Cohen 2015-05-11 20:32:11 UTC
Created attachment 92550 [details]
example of jpg
Comment 2 Raghavendra kamath 2015-05-12 15:53:48 UTC
Can you please attach the original PSD from which this jpg is saved. That will be helpful to the developers in determining whats happening.
Comment 3 Daniel Cohen 2015-05-12 15:55:15 UTC
There is no PSD involved in this process, this is literally a new file in doodled in photoshop saved as a jpeg with the default settings.
Comment 4 Halla Rempt 2015-05-15 09:46:32 UTC
Hm... Photoshop does do something weird.  This is where we try to get the resolution from:

cinfo.X_density 1 cinfo.y_density 1 unit 0 

Unit can be 1 or 2, and it is 0.
Comment 5 Halla Rempt 2015-05-15 09:47:48 UTC
Also interesting: gimp shows the XRes and YRes as 72 as well, but the real resolution apparently is stored in the exif properties...
Comment 6 Halla Rempt 2015-05-15 09:50:26 UTC
Curiouser and curiouser... In layer/edit metadata in Krita, we can see all the exiv and other properties, and there in the List tab, exif.PixelYDimension  and exif.PixelXDimensions are set 60 600. There is also... tiff.XResolution and tiff.Yresolution, and those are set to the 3000000/10000...

I guess I'd better check what gimp and imagemagick do here...
Comment 7 Halla Rempt 2015-05-15 10:22:51 UTC
Git commit db375418cbf46a80d6638a98479813ec8f8a283d by Boudewijn Rempt.
Committed on 15/05/2015 at 10:22.
Pushed by rempt into branch 'calligra/2.9'.

M  +10   -0    krita/plugins/formats/jpeg/kis_jpeg_converter.cc

http://commits.kde.org/calligra/db375418cbf46a80d6638a98479813ec8f8a283d