imagerotate()

Hier können Probleme und alles andere in Deutscher Sprache gelöst werden.
Post Reply
dearestapollo
Regular
Posts: 9
Joined: Mon Apr 03, 2006 4:36 pm

imagerotate()

Post by dearestapollo »

Und nochmal der ich. Hallo.

Dieses Mal geht es um Bilder in der Mediengalerie, die die falsche Perspektive haben. Normalerweise kann man die ja dann einfach rotieren, bis sie richtig stehen. Das habe ich vor einiger Zeit mit einigen Bildern in meiner Galerie auch getan, aber seit heute bekomme ich folgende Fehlermeldung!

Was ist passiert??? Wie kann das wieder zum laufen bringen? Ich fand das eigentlich ganz angenehm, jedes einzelne Bild anpassen zu müssen, bevor ich es in die Galerie stelle.

Hier die Meldung:
Fatal error: Call to undefined function: imagerotate() in /srv/www/htdocs/web2/html/s9/include/functions_images.inc.php on line 816
Vielen Dank für die Aufmerksamkeit!

dearestapollo
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: imagerotate()

Post by garvinhicking »

Hi!

Dein Provider hat die "GD-Bibliothek" nicht eingebunden, die für Bildoperationen benötigt wird. Wenn Du in der Konfiguration "imageMagick" aktivierst, kannst du testen, ob dies vorhanden ist. Wenn auch das fehlt, bietet dein PRovider leider keine Möglichkeit der Bildbearbeitung...

Viele Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dearestapollo
Regular
Posts: 9
Joined: Mon Apr 03, 2006 4:36 pm

Post by dearestapollo »

Wenn ich imageMagick aktiviere, kommt das dabei heraus. Das könnte aber auch daran liegen, dass ich es gar nicht installiert habe. Mich wundert nur, dass es vorher auch ging.

Warning: escapeshellcmd() has been disabled for security reasons in /srv/www/htdocs/web2/html/s9/include/functions_images.inc.php on line 405
Unable to execute: " -rotate '450' '/srv/www/htdocs/web2/html/s9/uploads/DSCF0671.JPG' '/srv/www/htdocs/web2/html/s9/uploads/DSCF0671.JPG'", error: , return var: 126

Warning: escapeshellcmd() has been disabled for security reasons in /srv/www/htdocs/web2/html/s9/include/functions_images.inc.php on line 413
Unable to execute: " -rotate '450' '/srv/www/htdocs/web2/html/s9/uploads/DSCF0671.serendipityThumb.JPG' '/srv/www/htdocs/web2/html/s9/uploads/DSCF0671.serendipityThumb.JPG'", error: , return var: 126
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post by falk »

Das sieht aber nach PHP-Sicherheits-Hinweis aus als nach fehlendem imagemagic
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Du müsstest dann mal deinen Provider fragen, wenn es früher ging. Dann hat er nämlich die GD-Library entfernt.

Viele Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dearestapollo
Regular
Posts: 9
Joined: Mon Apr 03, 2006 4:36 pm

Post by dearestapollo »

Sicherheitshinweis.. hm ok. die Frage wäre also, warum sollte der Provider so etwas tun??
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Das weiß vermutlich nur der Provider. :-)

GDLib ermöglicht theoretisch Sicherheitslücken. Ausserdem könnte der Provider PHP aktualisiert haben und vergessen haben GDLib wiede rzu aktivieren. Da gibt's durchaus mehrere Ansätze für. :)

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
dearestapollo
Regular
Posts: 9
Joined: Mon Apr 03, 2006 4:36 pm

Post by dearestapollo »

Danke für die Hinweise.

Also dann werde ich eben wieder einmal meinen Provider trietzen. Das kann ich ja mittlerweile.. und eigentlich bin ja recht zufrieden.. aber die verlängern meinen Vertrag bestimmt nicht mehr freiwillig hehe ;)
toy
Posts: 4
Joined: Wed Aug 11, 2004 10:57 am
Contact:

Post by toy »

trietze deinen Provider nicht zu doll, ich hab eine
PHP Version 5.1.2-1+b1 unter debian , obwohl
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.10
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

gibt es trotzdem keine imagerote() function
toy
Posts: 4
Joined: Wed Aug 11, 2004 10:57 am
Contact:

die lösung

Post by toy »

für alle die keinen bock haben php neu zu kompilieren,
einfach schnell imagerotate() gegen imageRotate() + dashier ersetzten

<?php

// $src_img - a GD image resource
// $angle - degrees to rotate clockwise, in degrees
// returns a GD image resource
// USAGE:
// $im = imagecreatefrompng('test.png');
// $im = imagerotate($im, 15);
// header('Content-type: image/png');
// imagepng($im);
function imageRotate($src_img, $angle, $bicubic=false) {

// convert degrees to radians
$angle = $angle + 180;
$angle = deg2rad($angle);

$src_x = imagesx($src_img);
$src_y = imagesy($src_img);

$center_x = floor($src_x/2);
$center_y = floor($src_y/2);

$cosangle = cos($angle);
$sinangle = sin($angle);

$corners=array(array(0,0), array($src_x,0), array($src_x,$src_y), array(0,$src_y));

foreach($corners as $key=>$value) {
$value[0]-=$center_x; //Translate coords to center for rotation
$value[1]-=$center_y;
$temp=array();
$temp[0]=$value[0]*$cosangle+$value[1]*$sinangle;
$temp[1]=$value[1]*$cosangle-$value[0]*$sinangle;
$corners[$key]=$temp;
}

$min_x=1000000000000000;
$max_x=-1000000000000000;
$min_y=1000000000000000;
$max_y=-1000000000000000;

foreach($corners as $key => $value) {
if($value[0]<$min_x)
$min_x=$value[0];
if($value[0]>$max_x)
$max_x=$value[0];

if($value[1]<$min_y)
$min_y=$value[1];
if($value[1]>$max_y)
$max_y=$value[1];
}

$rotate_width=round($max_x-$min_x);
$rotate_height=round($max_y-$min_y);

$rotate=imagecreatetruecolor($rotate_width,$rotate_height);
imagealphablending($rotate, false);
imagesavealpha($rotate, true);

//Reset center to center of our image
$newcenter_x = ($rotate_width)/2;
$newcenter_y = ($rotate_height)/2;

for ($y = 0; $y < ($rotate_height); $y++) {
for ($x = 0; $x < ($rotate_width); $x++) {
// rotate...
$old_x = round((($newcenter_x-$x) * $cosangle + ($newcenter_y-$y) * $sinangle))
+ $center_x;
$old_y = round((($newcenter_y-$y) * $cosangle - ($newcenter_x-$x) * $sinangle))
+ $center_y;

if ( $old_x >= 0 && $old_x < $src_x
&& $old_y >= 0 && $old_y < $src_y ) {

$color = imagecolorat($src_img, $old_x, $old_y);
} else {
// this line sets the background colour
$color = imagecolorallocatealpha($src_img, 255, 255, 255, 127);
}
imagesetpixel($rotate, $x, $y, $color);
}
}

return($rotate);
}

?>

hab ich hier gefunden.
http://no2.php.net/imagerotate
Buggy
Regular
Posts: 30
Joined: Wed Sep 14, 2005 11:32 pm

Post by Buggy »

habe das gleiche problem mit imagerotate(), wo soll ich deine geänderten Parameter einfügen Toy.

Gruss
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Den Code kannst du in die include/functions_images.inc.php einfügen.

Grüße,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply