resizing JPEGs (with Img and photo image)



Ok...I'm probably missing something stupid and obvious, but either
way, I'm clearly missing it....

I'm working on a new neat idea for JStrack (the freeware hurricane
tracking program I wrote---see www.jstrack.org), specifically (if the
user wants to do so), downloading the current satellite imagery and,
overlaying it on top of (well, actually under) the existing
map/coordinate grid. Just two problems....

1) The satellite image and the map image are from two different views
(one from 22,300 miles in space directly above the equator, the other
a flat map), and the images will never line up perfectly...but by some
creative resizing (X axis stretched slightly more than Y axis) it
works out to be reasonably close.

2) The amount that I need to resize the image is not an integral
amount, it's a percentage (or, better still, a specific size
in pixels). Specifically (for the Gulf close-up), the image
needs to be resized from 720x480 (1.5:1) to 1324x980 (1.35:1)
to best fit with the map. Yeah, I know...but it actually looks
ok.

I've tried using -zoom ... but it'll only accept integral amounts, and
they're not percentages. I've tried specifying the image size, but I
just end up with multiple copies of the image. I've tried -zoom
combined with image size and -shrink ... but it doesn't work.

Can anyone point me in the right (for Unix, Windows, Mac, etc.)
direction? Assume Tcl/Tk 8.3.x or 8.4.x (if it has to be 8.4, that's
ok---just specify that and it'll be a requirement for the new feature)
with Img (already required for the satellite imagery).

Thanks,
--jim

PS: I've already got the satellite imagery display in its own
toplevel...but this is something I thought of this morning while
looking at the satellite imagery...specifically, it would be neat
to give users (and that includes me) the option of putting it
right on the chart with the map and plot on top of it...but if
I can't get things to line up reasonably well, it could just end
up being more misleading than useful, and that's a Bad Thing.

--
73 DE N5IAL (/4) | "This 'telephone' has too many
spooky130@xxxxxxx | shortcomings to be seriously considered
ICBM / Hurricane: | as a means of communication. The device
30.39735N 86.60439W | is inherently of no value to us."
| (Western Union internal memo, 1876)

.


Quantcast