No Highlight showing - Gallery 1.5.10

logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sat, 2009-01-17 03:20

Hi Team,

Gallery Version: 1.5.10 (Upgraded from 1.5.3)
PHP Version 4.4.8
Webserver: Apache 1.3.4
Image Processor: ImageMagick 6.7
Website: www.saintgeorge.org.au/gallery

Just upgraded from version 1.53 to 1.5.10. The installation went through smoothly and no errors where encountered in the upgrade. The database was also updated upon loggin in for the first time into 1.5.10. The problem we are having is this:

1. All the existing Albums that where upgraded from 1.5.3 display the highlight perfectly. Even on the front page I can see all the highlights perfectly. If I add a new Album to the Gallery either on the front page or as a sub album it does not show the highlight. All it shows is an empty box saying 'Requested item has no highlight'. I tried the 'Option' Administer front page and 'Rebuild Highlights' but that does not do anything.

2. If I modify a highlight for an Album which currently has a good working highlight it also does the same thing. It destroys the perfectly working highlight and displays an empty box saying 'Requested item has no highlight'. If you click on the link 'Requested item has no highlight' it takes you to the correct album perfectly.

Other things I have tried are 'Rebuilding thumbnails', 'Validate Albums', 'Find Orpans' etc. All come up as being ok.

I can also see that within each album a valid highlight is set as below the picture I can see the term 'highlight' in brackets.

This problem only cam about after upgrading to version 1.5.10.

I am afraid to modify the other albums or add new ones as this problem looks like it effects new albums or albums I modify.

The gallery is located at www.saintgeorge.org.au/gallery

Looking forward to hearing your thoughts on this strange problem.

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sat, 2009-01-17 09:37

Hi All,

Just did some further testing and found that it's not even creating the thumb nail images. Thouh when you click on the thumb nail it takes you to the picture.

I will look into the configuration and see what has changed from 1.5.3 to 1.5.10.

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sat, 2009-01-17 10:00

I enabled debuging to high and saw the following when trying to rebuild the highlight.

------

Rebuilding highlight 1
imageManipulation.php::37 -> Resizing Image: /home/s/saintvl/www/gallery/albums/album17/RIMG0037.jpg.
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album17/RIMG0037.jpg
imageManipulation.php::797 -> Compressing image: /home/s/saintvl/www/gallery/albums/album17/RIMG0037.jpg
util.php::183 -> Executing: '/usr/local/bin/convert' -size 200x200 '/home/s/saintvl/www/gallery/albums/album17/RIMG0037.jpg' -quality 70 -thumbnail 200x200 '/home/s/saintvl/www/gallery/albums/album03/album17.highlight.jpg'

Results:

none

Debug messages:

Status: 127 (expected 0)
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album03/album17.highlight.jpg
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album03/album17.highlight.jpg

Rebuilding highlight 2
imageManipulation.php::37 -> Resizing Image: /home/s/saintvl/www/gallery/albums/album09/DSC00632.jpg.
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album09/DSC00632.jpg
imageManipulation.php::797 -> Compressing image: /home/s/saintvl/www/gallery/albums/album09/DSC00632.jpg
util.php::183 -> Executing: '/usr/local/bin/convert' -size 200x200 '/home/s/saintvl/www/gallery/albums/album09/DSC00632.jpg' -quality 70 -thumbnail 200x200 '/home/s/saintvl/www/gallery/albums/album01/album09.highlight.jpg'

Results:

none

Debug messages:

Status: 127 (expected 0)
Rebuilding highlight 3
imageManipulation.php::37 -> Resizing Image: /home/s/saintvl/www/gallery/albums/album04/jesusicon1.jpg.
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album04/jesusicon1.jpg
imageManipulation.php::797 -> Compressing image: /home/s/saintvl/www/gallery/albums/album04/jesusicon1.jpg
util.php::183 -> Executing: '/usr/local/bin/convert' -size 200x200 '/home/s/saintvl/www/gallery/albums/album04/jesusicon1.jpg' -quality 70 -thumbnail 200x200 '/home/s/saintvl/www/gallery/albums/album02/album04.highlight.jpg'

Results:

none

Debug messages:

Status: 127 (expected 0)
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album02/album04.highlight.jpg
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album02/album04.highlight.jpg

--------------------

Does the above look normal?

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sat, 2009-01-17 10:06

I get the following when addin a new photo as well. It does not display the thumbnail too.

--------------

save_photos.php::358 -> Now we start processing the given Files. (If they were given)
Processing 1 element.
albumItem.php::506 -> Entering function: 'processnewimage'
albumItem.php::508 -> Processing file: /tmp/php_upload/php9R8Il1
albumItem.php::666 -> Start processing single file (image/movie not archive).
albumItem.php::669 -> Extension is accepted.
albumItem.php::671 -> Filename processing.
albumItem.php::720 -> No caption given, generating it.
albumItem.php::479 -> Generated caption. Type: no caption
Adding starwarscake.jpg
Album.php::1312 -> Doing the naming of the physical file.
Album.php::1350 -> Image preprocessing
Album.php::1355 -> Resizing/compressing original file
imageManipulation.php::37 -> Resizing Image: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg.
filesystem.php::109 -> extension of file starwarscake.jpg is jpg
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg
util.php::247 -> Dimensions: x: 500 y: 400
imageManipulation.php::73 -> No resizing required.
imageManipulation.php::676 -> File /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg type 2.
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg
util.php::247 -> Dimensions: x: 500 y: 400
AlbumItem.php::697 -> Generating thumbnail.
AlbumItem.php::700 -> Saved dimensions: width:500 ; height:400
AlbumItem.php::778 -> Generating normal thumbs.
imageManipulation.php::37 -> Resizing Image: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg.
filesystem.php::109 -> extension of file starwarscake.jpg is jpg
util.php::237 -> Getting Dimension of file: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg
util.php::247 -> Dimensions: x: 500 y: 400
imageManipulation.php::797 -> Compressing image: /home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg
util.php::183 -> Executing: '/usr/local/bin/convert' -size 150x150 '/home/s/saintvl/www/gallery/albums/album21/starwarscake.jpg' -quality 50 -thumbnail 150x150 '/home/s/saintvl/www/gallery/albums/album21/starwarscake.thumb.jpg'

Results:

none

Debug messages:

Status: 127 (expected 0)
util.php::621 -> Got no capture date. Using file modification time.
util.php::632 -> Item Capture Date: Sat Jan 17 21:05:06 2009
Album.php::1443 -> Check if image needs to be rotated

-----------------------

If anyone has any tips it would be greatly appreciated.

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sat, 2009-01-17 10:58

Hi Team,

Making a little headway into this.

Found a good script within the setup directory 'http://www.yourgallerysite.com/gallery/setup/check_imagemagick.php'

It tests to see whether the binaries are working correctly. When doing this I found error in the Convert binary and identify binary. The composite binary tested OK.

For 'Convert' & 'Identify' I received: 'Expected status: 0, but actually received status 1.'

I have emailed my ISP to confirm that ImageMagick is working correctly on the server.

Funny though because I was not having any issues with version 1.5.3

Will report back the results.

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Sun, 2009-01-25 23:58

** SOLUTION **

I did a comparison between my 1.5.3 version and the new 1.5.10 version of imageManipulation.php which is found in the '/lib' folder. When I originally did the installation a couple of years ago I found that in that file I had to make some modifications in order to get it working with our web server.

This worked perfectly for me once I added these modifcations into the 1.5.10 version. If your not interested in reading below you may download my modified version of the imageManipulation.php and replace your existing one.

1. Download at: http://www.logicserver.net/downloads/patches/imageManipulation.zip
2. Create a backup copy of the /lib/imageManipulation.php
3. Replace the /lib/imageManipulation.php using the modified version.

Caution: Please make a backup of your imageManipulation.php file before using my modifed version.

If you would like to know the code I have added he you go.

On Line 822 Add the following code with out the '--' symbols:

--
// Imagemanipulation Change
$gallery->app->graphics = "GD";
--

On Line 910 Add the following code with out the '--' symbols:

--
// Imagemanipulation Change
case "GD":

if ($targetSize) {
if ($createThumbnail) {
$system=explode('.',$src);

if (preg_match('/jpg|jpeg/',$system[1])){
$src_img=imagecreatefromjpeg($src);
} elseif (preg_match('/png/',$system[1])){
$src_img=imagecreatefrompng($src);
} elseif (preg_match('/gif/',$system[1])){
$src_img=imagecreatefromgif($src);
}

$old_x=imageSX($src_img);
$old_y=imageSY($src_img);

$new_w = $targetSize;
$new_h = $targetSize;
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}

$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);

if (preg_match('/jpg|jpeg/',$system[1])){
imagejpeg($dst_img,$dest);
} elseif (preg_match('/png/',$system[1])){
imagepng($dst_img,$dest);
} elseif (preg_match('/gif/',$system[1])){
imagegif($dst_img,$dest);
}

imagedestroy($dst_img);
imagedestroy($src_img);
}
}
return true;
break;
--

 
Infinitee
Infinitee's picture

Joined: 2008-05-01
Posts: 9
Posted: Mon, 2009-01-26 11:21

Exactly where did you find "imageManipulation.php"?

It's not in the ImageMagick module folder.

Ralph Manis
Infinitee Designs

 
logicsolutions

Joined: 2009-01-16
Posts: 9
Posted: Mon, 2009-01-26 20:44

imageManipulation.php is a gallery script and not an ImageMagick library. In version 1.5 of Gallery it is found in the '/lib' folder.

I.E. www.yourgallerysite.com/gallery/lib/imageManipulation.php

 
y_not

Joined: 2009-02-20
Posts: 1
Posted: Fri, 2009-02-20 20:43

BUMP

Still have the same problem. :(

 
Tmack0

Joined: 2009-09-25
Posts: 1
Posted: Fri, 2009-09-25 16:59

In the mentioned file, under the section that starts with "* Returns the command line command for ImageMagick depending on Version." around line 768

Check your imagemagick version (ie /(path to imagemagick bins)/convert -version ), and comment out the version checking to use your specific version (mine was 6+) as follows (~lines 786-791):

# if($ImVersion < 6) {
# $cmdLine = "$cmd $srcOperator $destOperator $src $dest";
# }
# else {
$cmdLine = "$cmd $srcOperator $src $destOperator $dest";
# }

Seems something broke in Gallery's ability to figure out what imagemagick version is running, this just hard-codes it. If you update imagemagick from < 6 to 6+, you will have to revisit this to switch the commented line around.

The solution OP mentions adds support for GD, which is usually built into php, and can be used as an alternative to imagemagick and netpbm to some degree