Bug #1126
Extracting Exif from PNG in Exiv2-0.25
100%
Description
I can't import PNG metadata using 0.25 version of Exiv2. The reason I think it's a bug (pardon me if I am wrong) is that the same code worked with 0.24 version.
Thanks,
Mikayel
Files
Related issues
Associated revisions
History
Updated by Robin Mills about 6 years ago
- Status changed from New to Assigned
- Priority changed from Urgent to Normal
Mikayel
Do you have a test PNG image?
I am very surprised by your report because I can't think of any changes to pngimage.cpp for v0.25 that could have caused this.
Are you sure that you have libz linked to your code? You need libz for PNG support. Run this command:
514 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 --verbose --version --grep libz exiv2 0.25 001900 (64 bit build) library=/usr/local/lib/libz.1.dylib library=/usr/lib/libz.1.dylib have_libz=0 515 rmills@rmillsmbp:~/gnu/exiv2/trunk $I ran this the Mac, the output will be a little different on Windows or Linux. However you can see libz shared object/dll in memory.
Windows:
C:\cygwin64\home\rmills\gnu\exiv2\trunk\msvc2005\bin\win32\releasedll>exiv2 --verbose --version --grep zlib --grep libz exiv2 0.25 001900 (32 bit build) library=C:\cygwin64\home\rmills\gnu\exiv2\trunk\msvc2005\bin\win32\releasedll\zlib1.dll have_libz=1 C:\cygwin64\home\rmills\gnu\exiv2\trunk\msvc2005\bin\win32\releasedll>
Linux:
1004 rmills@rmillsmm-kubuntu:~/gnu/exiv2/trunk $ exiv2 --verbose --version --grep libz --grep zlib --grep lib exiv2 0.25 001900 (64 bit build) library=/usr/local/lib/libz.so.1 have_libz=1 1005 rmills@rmillsmm-kubuntu:~/gnu/exiv2/trunk $You will always report have_libz= either 0 or 1. However you'll only report the library=path-to-library when your building exiv2 to use DLLs or shared objects. If you statically link, the DLL/shared object will not be loaded at run-time. However, you will have LIBZ and therefore PNG support.
Incidentally, I see --verbose --version is incorrectly reporting have_libz=0. I've logged that as #1127 fixed it r3978 and r3980. It's reporting correctly now, as you can see on the Windows and Linux output which was built after I submitted r3978.
Updated by Mikayel Egibyan about 6 years ago
I have zlib1.dll and zlib1.lib but I don't know what libz is?
Mikayel
Updated by Mikayel Egibyan about 6 years ago
- File 1796916_10155735224985483_5543419639968711499_o.png 1796916_10155735224985483_5543419639968711499_o.png added
Please find attached an example of PNG image.
Updated by Mikayel Egibyan about 6 years ago
Online Exif extractors find data in the image (e.g. http://exifdata.com/exif.php)
Updated by Alan Pater about 6 years ago
- Category changed from exif to metadata
The test file appears to include only IPTC and ICC metadata, not EXIF.
exiv2 can read the IPTC metadata but not the ICC (Colour Profile) metadata.
Updated by Robin Mills about 6 years ago
zlib1.dll on Windows is the same thing as libz.so.1 on Linux and libz.1.dylib on Mac. Very inconsistent names. However that's how it is.
exiftool is reporting lots of metadata - however I don't believe it is Exif data (I discuss this later). exiv2 v0.22, v0.24 and trunk (v0.25) says "No Exif data found in the file".
I'm not sure there is a case to answer here, Mikayel. You'll have to find more solid evidence that we've changed something.
Exiv2 v0.22
571 rmills@rmillsmbp:~/gnu/exiv2/0.22 $ exiv2 -V ; exiv2 ../0.24/1796916_10155735224985483_5543419639968711499_o.png exiv2 0.22 001600 (64 bit build) Copyright (C) 2004-2011 Andreas Huggel. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA File name : ../0.24/1796916_10155735224985483_5543419639968711499_o.png File size : 110831 Bytes MIME type : image/png Image size : 91 x 720 ../0.24/1796916_10155735224985483_5543419639968711499_o.png: No Exif data found in the fileExiv2 v0.24
572 rmills@rmillsmbp:~/gnu/exiv2/0.22 $ cd ../0.24 573 rmills@rmillsmbp:~/gnu/exiv2/0.24 $ sudo make install >/dev/null 574 rmills@rmillsmbp:~/gnu/exiv2/0.24 $ exiv2 -V ; exiv2 ../0.24/1796916_10155735224985483_5543419639968711499_o.png exiv2 0.24 001800 (64 bit build) Copyright (C) 2004-2013 Andreas Huggel. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA File name : ../0.24/1796916_10155735224985483_5543419639968711499_o.png File size : 110831 Bytes MIME type : image/png Image size : 91 x 720 ../0.24/1796916_10155735224985483_5543419639968711499_o.png: No Exif data found in the fileTrunk (v0.25)
575 rmills@rmillsmbp:~/gnu/exiv2/0.24 $ cd ../trunk/ 576 rmills@rmillsmbp:~/gnu/exiv2/trunk $ sudo make install >/dev/null 577 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -V ; exiv2 ../0.24/1796916_10155735224985483_5543419639968711499_o.png exiv2 0.25 001900 (64 bit build) Copyright (C) 2004-2015 Andreas Huggel. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA File name : ../0.24/1796916_10155735224985483_5543419639968711499_o.png File size : 110831 Bytes MIME type : image/png Image size : 91 x 720 ../0.24/1796916_10155735224985483_5543419639968711499_o.png: No Exif data found in the file 578 rmills@rmillsmbp:~/gnu/exiv2/trunk $I think exiftool is mostly report ICC profile data.
exiftool:
578 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiftool ../0.24/1796916_10155735224985483_5543419639968711499_o.png ExifTool Version Number : 10.02 File Name : 1796916_10155735224985483_5543419639968711499_o.png Directory : ../0.24 File Size : 108 kB File Modification Date/Time : 2015:10:08 17:35:55+01:00 File Access Date/Time : 2015:10:08 17:49:13+01:00 File Inode Change Date/Time : 2015:10:08 17:43:36+01:00 File Permissions : rw-r--r-- File Type : PNG File Type Extension : png MIME Type : image/png Image Width : 91 Image Height : 720 Bit Depth : 8 Color Type : RGB Compression : Deflate/Inflate Filter : Adaptive Interlace : Noninterlaced Original Transmission Reference : mM-aKMqieBxJiF2_i2Q5 Profile Name : icm Profile CMM Type : lcms Profile Version : 2.1.0 Profile Class : Display Device Profile Color Space Data : RGB Profile Connection Space : XYZ Profile Date Time : 2012:01:25 03:41:57 Profile File Signature : acsp Primary Platform : Apple Computer Inc. CMM Flags : Not Embedded, Independent Device Manufacturer : Device Model : Device Attributes : Reflective, Glossy, Positive, Color Rendering Intent : Perceptual Connection Space Illuminant : 0.9642 1 0.82491 Profile Creator : lcms Profile ID : 0 Profile Description : c2 Profile Copyright : FB Media White Point : 0.9642 1 0.82491 Media Black Point : 0.01205 0.0125 0.01031 Red Matrix Column : 0.43607 0.22249 0.01392 Green Matrix Column : 0.38515 0.71687 0.09708 Blue Matrix Column : 0.14307 0.06061 0.7141 Red Tone Reproduction Curve : (Binary data 64 bytes, use -b option to extract) Green Tone Reproduction Curve : (Binary data 64 bytes, use -b option to extract) Blue Tone Reproduction Curve : (Binary data 64 bytes, use -b option to extract) Image Size : 91x720 Megapixels : 0.066 579 rmills@rmillsmbp:~/gnu/exiv2/trunk $Dumping the structure of the PNG shows:
581 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -pS ../0.24/1796916_10155735224985483_5543419639968711499_o.png STRUCTURE OF PNG FILE: ../0.24/1796916_10155735224985483_5543419639968711499_o.png address | index | chunk_type | length | data 8 | 0 | IHDR | 13 | 33 | 1 | zTXt | 100 | Raw profile type iptc..x.=....0. 145 | 2 | iCCP | 276 | icm..(.c``..I.-f.``..+).rwR...R` 433 | 3 | IDAT | 8192 | x^..w.^Gy7.....^.7.vWZu...{..;.c 8637 | 4 | IDAT | 8192 | ...gF........O ./.7...B\.m..,;.. 16841 | 5 | IDAT | 8192 | ..........hoY@.L..4.[....Q.%>.& 25045 | 6 | IDAT | 8192 | ."..a.(.....l.=...K.N.z....AB.P 33249 | 7 | IDAT | 8192 | ......\r&.O.S........D.V...+..;. 41453 | 8 | IDAT | 8192 | ..<'Y,%.......Wi.....iRJ.|..A{.> 49657 | 9 | IDAT | 8192 | O.<..|......v..].a[s.{|([]....rY 57861 | 10 | IDAT | 8192 | .,...........o^'....}...Z@.!)%W. 66065 | 11 | IDAT | 8192 | p$Ja...k..{.Z$.lnnfB.....;....;j 74269 | 12 | IDAT | 8192 | ....)..........._yJP.......[".$ 82473 | 13 | IDAT | 8192 | ........7.^\...=w.....h..P@.e... 90677 | 14 | IDAT | 8192 | .,...."S8.........s.....H..T..` 98881 | 15 | IDAT | 8192 | ....o...^.....+.Ri........D).<.. 107085 | 16 | IDAT | 3722 | .i.<`.......3m...,=......,!.Y;c 110819 | 17 | IEND | 0 | 582 rmills@rmillsmbp:~/gnu/exiv2/trunk $As you can see there's an IPTC 'profile'. I think the ICM data may be a colour profile. One of the projects for v0.26 is to extract/replace ICC profiles. #1074 At the moment, I've done this for JPG and haven't found a suitable test file for PNG. Thanks for this file, this will be very useful.
Updated by Robin Mills about 6 years ago
- Status changed from Assigned to Resolved
- Target version set to 0.26
- % Done changed from 0 to 100
- Estimated time set to 2.00 h
I'm going to mark this 100% resolved. Mikayel, if you find reproducible evidence, please add it to this issue report and it will be investigated.
#1126 Fixes submitted for msvc2003