Hi Frank,
After this post, we should probably go offline to for banter. I *did* get that you had taken my first cut at a help file. I was trying to say, "good, I'm pleased that you did."
I was surprised by the error message you reported. It's from "get_width_height" that does image resizing. I couldn't get auto-resizing to do anything (as far as I could tell anyway). When I started, I thought that 4images was able to generate thumbnails automatically and on the fly. So I looked at how I could accomplish the same thing. Basically, the approach I took to resizing was just to let the browser handle it. I calculated the width/height parameters and got them included with the HTML that 4images was generating. For the slide show, the image references are included in a JavaScript data structure. So I added the width/height parameters of the image to the data structure and sized it at the time the images were being changed.
PLEASE FORGIVE THE INCLUSION OF CODE HERE. I'M REALLY A NOVICE AT CONTRIBUTING TO FORUMS AND DON'T KNOW THE PROTOCOL FOR ADDING THIS KIND OF THING. (I'VE SEEN CODE IN SCROLLING TEXT AREAS ON THIS FORUM, BUT DON'T KNOW HOW TO CREATE ONE.) (Please forgive the caps there too.
)
When that didn't seem to be the case, I started uploading thumbnails. Since I wanted some resizing and was having problems seeing any resizing actually happening, I took another approach. I went to includes/functions.php: get_media_code right after:
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
and included the following code. (I had compromised my web site and just wanted to get it back up quickly. Since I have seen web stats that only about 10-15% of users use a resolution less than 1024x768, I coded for that size--and will do better at some future date.):
//!!! Don't let the image get too large to display on a 1024x768 screen. I'd eventually like resize the image optimized
// for the actual screen size dynamically in JavaScript. (The code to maximize an image's size is in
// gallery/scripts/images.js.)
$shrink = false;
$max_ht = 500;
$max_width = 900;
if ($height > $max_ht)
{
$height = $max_ht;
$pct = $image_info[1] / $height;
$width = round($image_info[0] / $pct);
$shrink = true;
}
if ($width > $max_width)
{
$width = $max_width;
$pct = $image_info[0] / $width;
$height = round($image_info[1] / $pct);
$shrink = true;
}
if ($shrink)
{
$image_info[3] = "width=\"" . $width . "\" height=\"" . $height . "\"";
$width_height = " ".$image_info[3];
$image_info[0] = $width;
$image_info[1] = $height;
}
There is some similar code in JavaScript that I used for the dynamic image resizing for the slide show.
You're probably right that this kind of thing should probably go in a different section. When I had everything working, I was thinking about offering my mods back to the group--although they probably fit in a number of different categories.
Sorry for the length of this post. I hope it was informative and helpful though.
David