(I've asked this before, but the thread fizzled)
http://groups.google.com/group/comp.lang.postscript/browse_thread/thread/ca973ffaf885834c/56f107d7b68ee435?hl=en#56f107d7b68ee435
I would like to use ghostscript to make a thumbnail of the first page of a PDF file,
or an EPSF file, to the following spec.
* The thumbnail must have the SAME aspect ratio as the original
* the size of the longest side of the thumbnail must be 128 pixels
The correct pixels can be easily made, by simply rendering at a "too-high"
resolution, and then using ImageMagick:
convert <raster> -resize 128x128 <thuumbnail>
But this can be resource hungry for large media sources. Setting the
resolution high enough to get good thumbs for tiny images
(e.g. a business card image) leaves the resolution FAR
too high for large images (like a newspaper page).
Using info from the previous thread the closest approach is to use these flags:
-r72 -dDEVICEWIDTHPOINTS=128 -dDEVICEHEIGHTPOINTS=128 -dPDFFitPage -dEPSFitPage
Which gives me a 128x128 raster every time. But if the aspect ratio
of the original is NOT 1:1, I either get white padding
on the right, or white padding on the top.
Can anyone suggest a way to get my "dream" thumbnail,
i.e. the same pixels as I'm currently getting, but with
no padding?
The closest I can get at the moment is a second pass with ImageMagick using
options to trim any exterior whitespace
-bordercolor white -border 1x1 -trim +repage
But this will remove any peripheral white
*content* as well as the white padding from the rendering.
All help welcomed (and I bet I'm not the only one wanting this)
BugBear