Closed lucastimmons closed 8 years ago
Same problem.
I want to resize an image but also keep the ImageDescritpion as part of the exif data.
hMatoba/MinifyJpegAsync doesn't keep the ImageDescription data. So I was going to use piexifjs to copy the ImageDescription into memory, resize the image, then write the image description back to the resized image and download it.
In both projects the ImageDescription (Tag 270) isn't extracted from the image when the image is loaded in. In the example in hMatoba/MinifyJpegAsync the image description is gone when the image is downloaded.
As you can see in these screen grabs, the photo itself has an image description but it doesn't appear when loaded into the PixelifJS LoadSample.html file.
This doesn't happen for every file. Sometimes the image description does show up. I just need to have a way to make sure it always shows up, even if it means no other metadata is saved.
Could yo give me images?
Here are three I've tried and I get no image description but they do all have an image description.
http://awesome.lucastimmons.com/testimages/1.jpg http://awesome.lucastimmons.com/testimages/2.jpg http://awesome.lucastimmons.com/testimages/3.jpg
Is this really exif's ImageDescription? Isn't it XMP's?
Here's one that came from the same source that does work in the LoadSample.html file. http://awesome.lucastimmons.com/testimages/4.jpg
Looking at the raw data for both, the description is tagged like this:
img2.jpg:
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">A gate blocks the entrance to Richard Henry Bain's fishing camp in La Conception, near Mont-Tremblant, Que. on Wednesday Sept. 5, 2012. Police sources confirmed they arrested a suspect by that name in the Montreal shooting that left one person dead and made headlines around the world. THE CANADIAN PRESS/Andy Blatchford</rdf:li>
</rdf:Alt>
</dc:description>
img4.jpg dc:description rdf:Alt
Isn't it XMP's!? Have you tried other library? I tried and can't find "ImageDescription" in exif.
The loadsample.html example doesn't show ImageDescription (270) when the image loads. I can't find a way to extract it.
Using the library I can write to 270 (zerothIfd[piexif.ImageIFD.ImageDescription] = "Description"; in the dumpsample.html file.
Is there a reason ImageDescription doesn't appear?