Discussion:
tif to jpg conversion question
William Tantzen
2011-07-12 18:18:52 UTC
Permalink
I have a php script that does a very simple minded conversion of tif files,
the guts of which looks like:

$magick->resizeImage ( 600, 0, imagick::FILTER_UNDEFINED, 1, FALSE );

A recently uploaded image rendered as extremely blurry, whereas the original
was very high density and sharp.

I investigated by issuing a simple convert at the command line, and the
result was TWO files, a nice jpg master and a thumbnail. Investigating
further now, identify reveals that my tiff is composed of both a master
image and a thumbnail.

identify test.tif
test.tif[0] TIFF 7923x6025 7923x6025+0+0 DirectClass 1.4e+02mb 0.410u 0:02
test.tif[1] TIFF 160x122 160x122+0+0 DirectClass 1.4e+02mb

My guess is now that the php code is actually upsizing the thumbnail part of
the file. Does that sound logical?

My question is, if this is actually the case, how can I handle uploads in a
general way, assuming more tiff files of this sort will eventually be
uploaded?

Obviously this is revealing some ignorance on my part as to the tiff format,
so if you can pass on any good sources of information that would be helpful,
please do so!

Thanks for helping me clarify this,
Bill
***@umn.edu
Fred Weinhaus
2011-07-13 20:00:20 UTC
Permalink
It may be that you have a pyramid tiff or ptif. I see two choices.
Either test for the number of resolutions and process them all in a
loop or just process the first one, test.tif[0].
Karl Billeter
2011-07-14 05:27:15 UTC
Permalink
Post by Fred Weinhaus
It may be that you have a pyramid tiff or ptif.
I know that Capture One software embeds thumbnails in tiffs. It can be quite
annoying.
Post by Fred Weinhaus
I see two choices. Either test for the number of resolutions and process
them all in a loop or just process the first one, test.tif[0].
We ended up looping through them and processing the largest. I wouldn't
assume largest would always be the first.

Karl

Loading...