patch attached. On 10/3/06, Edward Duffy <eduffy gmail com> wrote:
On 10/3/06, Jamie McCracken <jamiemcc blueyonder co uk> wrote: > René Stadler wrote: > > Am Dienstag, den 03.10.2006, 12:50 +0100 schrieb Jamie McCracken: > > [...] > >> I think for image files (gif, tiff and others) we might want to use > >> imageMagick's identify command to get the dimensions (especially if > >> libexif and libpng are not present as we can fallback on this too) > >> > >> EG > >> > >> identify -format "%wx%h" sample.jpg > >> 2112x2720 > >> > >> > >> this will allow us to get the Image.Width and Image.Height by parsing > >> stdout. We also dont need a hard dependency on ImageMagicks stuff. > >> > >> It can also be used to get comments embedded and other stuff like > >> resolutions in image : > >> > >> identify -format "%c" sample.jpg > >> > > [...] > > > > Using identify might be a bad idea. Last time I checked, it had the bad > > habit of performing all of its extraction and analysis capabilities > > (counting colors etc.) even if you just request things as simple as the > > geometry or the embedded comment (which should become available after > > just parsing a few bytes of most image formats). That is, it is very > > slow/wastes CPU cycles. For getting the geometry, I found that it is > > much faster and efficient to use a GdkPixbufLoader and connect to the > > "size-prepared" signal. Not that I think this is the perfect solution > > either (I think GdkPixbuf has already allocated memory to hold the > > complete decoded image when it emits the signal), but it tells about the > > deficiencies of Imagemagick. > > > > yes you might be right there (identify does seem a little slow on large > images) > It's not slow if you use the "-ping" parameter. Just a quick test with over 200 images, it took over 1 minute to run identify all images (most around 2MB), and 5 seconds with the -ping parameter. Shouldn't take me long to do this. > We cant depend on GDK either. > > I only suggested it as a fallback for images not supported by libexif or > libpng (which means stuff like tiff, gif, xpm et all). If we have time > we can extract libextractor's plugins for these other formats which > should be more efficient. > > -- > Mr Jamie McCracken > http://jamiemcc.livejournal.com/ >
Attachment:
tracker-extract-imagemagick.patch
Description: Text Data