Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting ImageMagick convert to not write out extra info

Tags:

imagemagick

I'm using ImageMagick's convert to resize some .png files, the problem is that convert seems to be writing some extra info to the .png:

EXtdate:create 2012-11-26T19:50:31-08:001

The problem is that if the source image didn't change, a new scaled down image is produced that is identical to the old one, but it has this extra time/date info and it's causing git to think all the files have changed.

Is there a way to keep convert from writing out this addition meta info so subsequent resizing won't show the files as changed is the source image didn't change?

like image 205
Roger Gilbrat Avatar asked Nov 27 '12 04:11

Roger Gilbrat


2 Answers

You're searching for the -strip parameter, ie:

convert infile.png -resize 100x100 -strip outfile.png
like image 148
Admiral H. Curtiss Avatar answered Oct 02 '22 00:10

Admiral H. Curtiss


I found the solution to this problem was adding:

+set date:create +set date:modify

The -strip option was not removing the embedded data, but this does.

like image 40
Roger Gilbrat Avatar answered Oct 01 '22 23:10

Roger Gilbrat