to continue using stoppdesign with the upgrade, add these lines to the corresponding files:
line 23 and on of i.php should look like this:
if(isset($_GET['s']) && $_GET['s'] < 3000) { // Disallow abusive size requests.
if ($_GET['s'] == "thumb") {
$thumb = true;
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;};
}
else {
$thumb = false;
}
$size = $_GET['s'];
}
and template-functions.php should have this block of code pasted in between functions, around line 534 (basically after the printAlbumThumbImage function):
function printAlbumThumbImageStopdesign($alt, $class=NULL, $id=NULL) {
echo "";
}
So I made the modification to the files in the main directory and this is what I get:
http://www.generalmagic.org/gallery/
Everything seems to work ok but the images themselves do not show. Any idea ?
I was upgrading from 1.01beta so I didn't re-do any other modification since I had the theme working previously. Was that the wrong way to do it ? Should I re-install the theme ?
Ok, now I think I got every thing right but as a consequence to the migration, it seems that the thumbnail image is either right for the gallery thumbnail or its attached photo thumbail.
Examples:
Animal & Face albums on : http://www.generalmagic.org/gallery/archive.php
and the photo thumbnail on:
http://www.generalmagic.org/gallery/index.php?album=Faces
and
http://www.generalmagic.org/gallery/index.php?album=Miscellaneous&image=Painting_1903_s.jpg
for example.
If I clear the album cache and reload a page with a thumbnail (let's say the gallery page), it'll get it right but the photo thumbnail will be wrong for the other entity (say the next photo thumbnail).
Erik
Yep, that's because it's a hack and doesn't save the wider images with different filenames...
I think 1.0.2 made this worse because it doesn't reprocess as much (a good thing). Once we make custom thumbs a part of the core, these problems should disappear (ntm we can include the stopdesign theme with the release ;-)
shoot! i forgot something...edasque, try making these changes to your config.php, then clear any cache files for the images that are screwed up (or all)
$conf['image_size'] = 480;
$conf['image_use_longest_side'] = true;
$conf['thumb_crop'] = true;
$conf['thumb_crop_width'] = 80;
$conf['thumb_crop_height'] = 80;
$conf['thumb_size'] = 100;
What you see is the correct behavior for the code, edasque. The hack doesn't make a different filename for the two thumbnails when it should to keep them separate. To get it working, you can add something to the filename.
Change line 37 of i.php to:
$newfilename = "/{$album}_{$image}_{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";
I haven't tested this, but it should work great.
sorry if I am being dense but with all the modifications, I don't know if I am looking at the right line.
Should I add this code to the end of:
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;
or right after:
} else {
$thumb = false;
Isn't it being overriden by:
$newfilename = "/{$album}{$image}{$size}.jpg";
in any case (around line 48 or so ?) Or should we check if the newfilename varriable is empty before (re) assigning it ?
I do dab in code but don't know much about PHP.
Erik
Answering my own post, this seems to have worked,
around line 48: if (empty($newfilename)) { $newfilename = "/{$album}{$image}{$size}.jpg"; }
and
$newfilename = "/{$album}{$image}{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";
was added right after
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;
This now works for me.
Excellent, thought so.
Like I said, I'll add native custom thumb sizes to a future release so we won't have to worry about hacking.
For future reference, I meant replace the line:
$newfilename = "/{$album}_{$image}_{$size}.jpg";
with the line:
$newfilename = "/{$album}_{$image}_{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";
but what you have should work fine as well, just a little kludgy.