Closed shilpi230 closed 8 years ago
How would you do this with the exiftool command-line application?
Extract the icc color profile of original image and attach it with whatever file with same mime type again using icc profile.
I have not much time at the moment. Could you give me please an example of command line arguments for exiftool to do this?
yeah sure or if you can tell me where can i edit the code. I can include it :)
No I don't mean mini_exiftool I mean the exiftool command-line application from Phil Harvey which uses mini_exiftool. I don't have the time to read all the documentation how to solve your requirements with exiftool.
first i am checking whether image has icc profile embedded or not if it is not then extract it form
exiftool -icc_profile -b -w icc filename
then attach it to some other image with exiftool '-ICC_Profile<=%d%f.icc' same_filename
With xmp format exiftool -Tagsfromfile filename out.xmp
and then attach it back with this command exiftool -TagsFromFile out.mp '-xmp:all<all' filename
To reattach you could try this with mini_exiftool:
photo = MiniExiftool.new('filename')
photo.copy_tags_from('out.xmp', ['all'])
But mini_exiftool is not designed to do such things. Maybe we could implement this with https://github.com/janfri/multi_exiftool my newer approach of a wrapper for exiftool.
So if the code above doesn't work it would be the best at the moment to do it on a direct way
system "exiftool -icc_profile -b -w icc filename"
system "exiftool '-ICC_Profile<=%d%f.icc' same_filename"
# or
system "exiftool -Tagsfromfile filename out.xmp"
system "exiftool -TagsFromFile out.xmp '-xmp:all<all' filename"
But be aware, you are responsible of handling errors.
Okay sure i will try my best :)
I extracted the metadata in xmp format from some jpeg and raw images now i need to attach that in some different file. How can i do that? I am able to do the same thing with ICC format with png images but its not working with jpeg images.