Page 1 of 1
imagemagick rotate
Posted: Fri Mar 31, 2006 9:43 pm
by flatloop
I'm not sure this is a bug, or a problem with my installation. When I try to rotate an image nothing happens. By nothing I mean the screen refreshes and the image is not rotated, nor is there an error message, at least not one that is readily visible... The rename and delete work fine, have not tried to resize anything.
I'm also using the usergallery plugin, but the folks over there don't think that usergallery is part of the problem.
Please let me know if you need more information.
Re: imagemagick rotate
Posted: Fri Mar 31, 2006 10:15 pm
by garvinhicking
Which version of imagemagick is installed on your system? Do you have SSH access to your installation and are you able to run imagemagick through SSH?
Regards,
Garvin
Posted: Fri Mar 31, 2006 11:12 pm
by flatloop
Okay I've got some more info... Firstly I do have shell access (It's in my basement). Version 6.2.4 (updated since the last post.)
Secondly, While playing around and updating... It is actually rotating the original, and not updating the thumbs. Even after I rebuild the thumbs.
The only other thing that I can't seem to do is filter the photos by their sub directory. Every time I try I get no images found, but if I look in all folders everything works.
Posted: Sat Apr 01, 2006 12:43 am
by garvinhicking
Hi!
If you could maybe edit your include/functions_images.inc.php and search for the serendipity_rotateImg function, you will see this code:
Code: Select all
/* Why can't we just all agree on the rotation direction? */
$degrees = (360 - $degrees);
/* Resize main image */
$cmd = escapeshellcmd($serendipity['convert']) . ' -rotate ' . serendipity_escapeshellarg($degrees) . ' ' . serendipity_escapeshellarg($infile) . ' ' . serendipity_escapeshellarg($outfile);
exec($cmd, $output, $result);
if ( $result != 0 ) {
echo '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
}
unset($output, $result);
/* Resize thumbnail */
$cmd = escapeshellcmd($serendipity['convert']) . ' -rotate ' . serendipity_escapeshellarg($degrees) . ' ' . serendipity_escapeshellarg($infileThumb) . ' ' . serendipity_escapeshellarg($outfileThumb);
exec($cmd, $output, $result);
if ( $result != 0 ) {
echo '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
}
unset($output, $result);
Please modify this to get the used output to:
Code: Select all
/* Why can't we just all agree on the rotation direction? */
$degrees = (360 - $degrees);
/* Resize main image */
$cmd = escapeshellcmd($serendipity['convert']) . ' -rotate ' . serendipity_escapeshellarg($degrees) . ' ' . serendipity_escapeshellarg($infile) . ' ' . serendipity_escapeshellarg($outfile);
echo "Full img: $cmd<br />\n";
exec($cmd, $output, $result);
if ( $result != 0 ) {
echo '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
}
unset($output, $result);
/* Resize thumbnail */
$cmd = escapeshellcmd($serendipity['convert']) . ' -rotate ' . serendipity_escapeshellarg($degrees) . ' ' . serendipity_escapeshellarg($infileThumb) . ' ' . serendipity_escapeshellarg($outfileThumb);
echo "Thumb: $cmd<br />\n";
exec($cmd, $output, $result);
if ( $result != 0 ) {
echo '<div class="serendipityAdminMsgError">'. sprintf(IMAGICK_EXEC_ERROR, $cmd, $output[0], $result) .'</div>';
}
unset($output, $result);
Then you should see the output of the used commands. Maybe you already see an error then; if the commands look sane, please execude said commands in your SSH shell. It might be a permission issue?
Best regards,
Garvin