You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not really a bug but an enhancement: is there any way to read EXIF data directly form a gm object?
In fact in my script I allow users to upload a photo so I already have the file's data loaded and a gm version of it to get its dimension. I'd like to read the EXIF data if possible without needing another library (and a third heavy variable).
I didn't find anything in the GraphicsMagick doc about reading exif data so I don't know if it's possible at all. Any suggestion?
The text was updated successfully, but these errors were encountered:
The right format string for Exif data is %[EXIF:*], so an actual code will look something like
gm(dir+'/image.jpg').identify('%[EXIF:*]',function(err,info){// info is a newline separated string of key=value pairs// imagemagick also prefixes each line with "exif:"varm,exif={},re=/^(?:exif:)?(\w+)=(.+)$/mg;while(m=re.exec(info)){exif[m[1]]=m[2];}console.log(exif);});
Not really a bug but an enhancement: is there any way to read EXIF data directly form a
gm
object?In fact in my script I allow users to upload a photo so I already have the file's data loaded and a
gm
version of it to get its dimension. I'd like to read the EXIF data if possible without needing another library (and a third heavy variable).I didn't find anything in the GraphicsMagick doc about reading exif data so I don't know if it's possible at all. Any suggestion?
The text was updated successfully, but these errors were encountered: