Some issues with creating contact sheets from tif

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Some issues with creating contact sheets from tif

Post by jamtat »

I need to make contact sheets from a large number of image files that are in both jpg and tif formats. I discovered the mogrify command and found some helpful samples of how to run it. Initial tests using some jpg files went quite well. However, as I try to use this command to make contact sheets from tif's I do not meet with success.

The command I'm running is

Code: Select all

montage -verbose -label '%f' -font Helvetica -pointsize 10 -background '#000000' -fill 'gray' -define jpeg:size=240x240 -geometry 240x240+2+2 -tile 5x6 -auto-orient *.tif contact-sheet/contact-dark.jpg
When I run that, no contact-dark.jpg gets generated. The process begins, but finally exits with the message "montage: unable to extent pixel cache `No such file or directory' @ fatal/cache.c/CacheSignalHandler/3353."

So, what am I doing wrong? According to some reading I've done, this should work with tif's. But maybe what I read is wrong, and I need to convert those to jpg for this to workl? ImageMagick 6.8.8-4

Thanks, James
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Some issues with creating contact sheets from tif

Post by snibgo »

It should work for any file type, but you may be out of memory. How many pixels, in total, in your tiffs? They take 8 bytes per pixel, which doesn't sound much, but you might have a billion pixels.
snibgo's IM pages: im.snibgo.com
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

Thanks for your reply, snibgo. I'm uncertain how many pixels are in those tif's: I'm not too well-versed in the technicalities of computer graphics and image processing. I'll go look up some information on how to determine that and report back here. I can at least say that the sizes of some are huge--some over 300 MB. But I tried that command on both some larger ones and smaller ones (ca. 15 MB) and the result was the same. Anyway, off to study up on how to determine how many pixels are in an image file.
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

Ok, the 15 MB ones show "Number pixels: 4.915M" when I open them with display and look at image info. I tried opening a really large one (433 MB) with display and got the same " unable to extent pixel cache `No such file or directory' @ fatal/cache.c/CacheSignalHandler/3353" error as when I try to run my montage command on these files. I'll see whether I can find an alternate means of determining pixels in that one.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Some issues with creating contact sheets from tif

Post by snibgo »

Try "identify x.tiff". That should show you the width and height. If it doesn't then the file may be corrupt. If that work, next try "identify -verbose x.tiff" which should show more metadata.
snibgo's IM pages: im.snibgo.com
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

Thanks for your continued interest: identify X.tif gives image.tif TIFF 12288x9216 12288x9216+0+0 8-bit CMYK 453MB 0.010u 0:01.790. Running identify -verbose X.tif results in the error message I reported in this thread's title: "identify: unable to extent pixel cache `No such file or directory' @ fatal/cache.c/CacheSignalHandler/3353."
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Some issues with creating contact sheets from tif

Post by snibgo »

At 8 bytes per pixel, that needs 1 GB of memory. If you don't have that much free RAM, ImageMagick should use disk. Do you have at least, say, 5 GB free disk? Generally IM uses the standard temporary area, in Windows called %TEMP%, but sometimes creates temporary files in your current directory.
snibgo's IM pages: im.snibgo.com
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

This is a Linux machine. It has 2GB of RAM and a 320 GB hard drive that is maybe 15% full. The images are on an external 500GB hard drive that is less than 10% filled. The RAM is a bit low on this machine but between the two hard drives there should be a few hundred GB's to spare. Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Some issues with creating contact sheets from tif

Post by snibgo »

Okay, you don't have enough physical memory, and IM is having problems creating temporary storage on disk. I don't know Linux, but you need to check that you have read/write access to the temporary directory.

See http://www.imagemagick.org/script/architecture.php under "Large Image Support".
snibgo's IM pages: im.snibgo.com
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

I do have read/write access to /tmp, if that's the directory imagemagick uses: I tested that just now by creating a file in that directory, then editing it. Anyway, I'll keep plugging away at this.

Turns out this may be less of a problem than troubles I'm encountering trying to batch convert tif's to jpg's--I'm now looking at an alternate approach to the contact sheets, one that creates a contact sheet and corresponding html files that point to fuller versions of the images (I read about it in imagemagick documentation). Browsers won't typically render tif's, so it seems I'll have to convert them in order to use that approach. But that's material for another thread.

Thanks
jamtat
Posts: 47
Joined: 2010-05-10T16:51:23-07:00
Authentication code: 8675308

Re: Some issues with creating contact sheets from tif

Post by jamtat »

I got frustrated with issues I was having under IM when trying to deal with these tif's, so I turned to netpbm. It''s so far handled all the manipulations I've tried with it and is much faster--it's main drawback as compared to using IM being the fact that it can't deal with spaces in file names (actually, I can't deal with them either, but the data came to me in this form, spaces already included). Still, it looks like running

Code: Select all

for f in *\ *; do mv "$f" "${f// /_}"; done
in that directory to replace all spaces in file names with underscores, then running netpbm to do the mass conversion of tif's to jpg's that I need to do, may be the path of least resistance here.
Post Reply