Solved

gd module perl rotate

Posted on 2004-04-13
17
520 Views
Last Modified: 2011-10-03
hi there,

i am trying to run

   my $srcimage = GD::Image->newFromJpeg("$source_jpeg");
   $srcimage->rotate180();

cant get it to work? is there something i am not knowing? anybody have a code snippet.

I am trying to rotate an image 90 degrees.
0
Comment
Question by:zubinnt
17 Comments
 
LVL 10

Expert Comment

by:rj2
ID: 10813808
use GD;
$source_jpeg='e:/temp/test.jpg';
my $srcimage = GD::Image->newFromJpeg($source_jpeg);
my $newimage = $srcimage->copyRotate90();
binmode(STDOUT);
print $newimage->jpeg;
0
 

Author Comment

by:zubinnt
ID: 10813919
nope does not work.

script cannot run with my $newimage = $srcimage->copyRotate90();
0
 

Author Comment

by:zubinnt
ID: 10813962
D:\Program Files\Apache Group\Apache2\cgi-bin\onlinephoto>test.pl
Can't locate object method "copyRotate90" via package "GD::Image" (perhaps you f
orgot to load "GD::Image"?) at D:\Program Files\Apache Group\Apache2\cgi-bin\onl
inephoto\test.pl line 8.
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10813969
Hi zubinnt,
Check that you have a recent version of GD:
http://search.cpan.org/~lds/GD-2.12/GD.pm

If you version is too old, you should get a new one.

Cheers,
Stefan
0
 

Author Comment

by:zubinnt
ID: 10814053
PPM> install gd
Version 2.06 of 'GD' is already installed.
Remove it, or use 'verify --upgrade GD'.
0
 

Author Comment

by:zubinnt
ID: 10814448
i have the latest install of GD for windows perl

i am using

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com
Built 21:33:05 Jun 17 2002

is there a problem with windows perl with this module ??

are there any alternatives ?
0
 
LVL 10

Expert Comment

by:rj2
ID: 10814516
Uninstall v. 5.6.1.
Install 5.8 instead, can be downloaded from
http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.3.809-MSWin32-x86.msi
After Installing run command below to install GD
ppm install http://theoryx5.uwinnipeg.ca/ppms/GD.ppd
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Expert Comment

by:rj2
ID: 10814543
Then run the script I posted in first comment and now it should work
0
 
LVL 10

Accepted Solution

by:
rj2 earned 500 total points
ID: 10814942
>is there a problem with windows perl with this module ??

yes. I got same problem also with 5.6.1.
Installing 5.8 instead fixed it for me.
0
 

Author Comment

by:zubinnt
ID: 10815059
currently using image magick ... i may try an installation at a later date.

0
 
LVL 10

Expert Comment

by:rj2
ID: 10815844
Ok. Here is link to ImageMagick that includes PerlMagick for latest ActiveState Perl (5.8 build 809)
Perl modules is included in installation (remember to select check box )
ftp://ftp.imagemagick.org/pub/ImageMagick/binaries/ImageMagick-6.0.0-Q8-windows-dll.exe
0
 
LVL 18

Expert Comment

by:kandura
ID: 10828547
ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/GD.ppd

will install GD 2.12 for Perl 5.6.1, in case you still want it.

I recall having installed a version of Image::Magick with the correct perl libraries for 5.6.1, but I can't seem to find my notes on that anymore.
I know I googled around for it, and found it eventually.

I know this module has helped me a lot in finding modules not available from activestate:
http://search.cpan.org/author/PODMASTER/PPM-Repositories-0.09/Repositories.pm

See the source of that module for a list of alternative ppm repositories.
0
 

Author Comment

by:zubinnt
ID: 10994164
this disussion is closed,

the original question was about the code ...

however, it's not the code that is the problem it is active perl. the latest installation of active perl solves everything


0
 
LVL 10

Expert Comment

by:rj2
ID: 10995071
Ok. Then you shoulc click "Accept comment as answer" on the comment you feel helped you the most to close the question.
0
 
LVL 10

Expert Comment

by:rj2
ID: 11027120
Aasker solved problem another way ??

I said in a comment that  "yes. I got same problem also with 5.6.1. Installing 5.8 instead fixed it for me."
And asker did just that.
So I do not agree that asker solved problem another way.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl strange behaviour 5 67
compress files in RAR using perl 13 79
collecting information 2 135
Perl Frameworks 1 78
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now