xabi
asked on
Image::Magick crop problem
Hi there:
I'm tryingto crop an image with Image::Magick but not at the TopLeft position. I'm ussing this:
#!/usr/bin/perl
use Image::Magick;
my $imImage = Image::Magick->new;
$imImage->Read("try.gif");
$imImage->Crop(geometry=>" 50x20+40+6 0");
print "Content-type: image/gif\n\n" . $imImage->ImageToBlob(magi ck=>'gif') ;
But what I get is an image like this:
|<----------- 90 ----------------->|
|<------- 50 ------->|
+------------------------- ---------+ -
| | ^
| TRANSPARENT | |
| | |
| | |
| +--------------------+ 80 -
| | | | ^
| | DESIRED CROPPED | | |
| | | | 20
| | IMAGE | | |
| | | v v
+-------------+----------- ---------+ - -
What's wrong with this?
xabi
PS:
- If I use print "Content-type: image/png\n\n" . $imImage->ImageToBlob(magi ck=>'PNG') ; seems to work.
- Explorer renders the cropped image well, but mozilla no.
I'm tryingto crop an image with Image::Magick but not at the TopLeft position. I'm ussing this:
#!/usr/bin/perl
use Image::Magick;
my $imImage = Image::Magick->new;
$imImage->Read("try.gif");
$imImage->Crop(geometry=>"
print "Content-type: image/gif\n\n" . $imImage->ImageToBlob(magi
But what I get is an image like this:
|<----------- 90 ----------------->|
|<------- 50 ------->|
+-------------------------
| | ^
| TRANSPARENT | |
| | |
| | |
| +--------------------+ 80 -
| | | | ^
| | DESIRED CROPPED | | |
| | | | 20
| | IMAGE | | |
| | | v v
+-------------+-----------
What's wrong with this?
xabi
PS:
- If I use print "Content-type: image/png\n\n" . $imImage->ImageToBlob(magi
- Explorer renders the cropped image well, but mozilla no.
Does it help if you add statement below before first print?
binmode(STDOUT);
binmode(STDOUT);
ASKER
That's not the problem.
I also did:
print "Content-type: image/gif\n\n";
binmode STDOUT;
$imImage->Write('gif:-');
with the same results.
xabi
I also did:
print "Content-type: image/gif\n\n";
binmode STDOUT;
$imImage->Write('gif:-');
with the same results.
xabi
Does the problem only occur in Mozilla? It seems to work alright with gif in IE
Is the problem that image don't get cropped, but is displayed as same size as before with the parts that should be cropped as transparent?
Is the problem that image don't get cropped, but is displayed as same size as before with the parts that should be cropped as transparent?
ASKER
well, In mozilla image isn't displayed right. Anyway I don't want this crop to use with mozilla, but to use it with cellular phones.
With the cells it down't works (but ericsson).
xabi
With the cells it down't works (but ericsson).
xabi
>With the cells it down't works (but ericsson).
I don't understand your statement above. What does works and what does not work? What happens when it does not work?
I don't understand your statement above. What does works and what does not work? What happens when it does not work?
ASKER
This is the Image I get from the script above:
http://xa.bi/files/cropped.gif
and the original is:
http://xa.bi/files/try.gif
xabi
Try the result image in mozilla and in Explorer. In a cellular phone i get the same result as Mozilla.
http://xa.bi/files/cropped.gif
and the original is:
http://xa.bi/files/try.gif
xabi
Try the result image in mozilla and in Explorer. In a cellular phone i get the same result as Mozilla.
Nothing has happened on this question in more than 6 weeks. It's time for cleanup!
My recommendation, which I will post in the Cleanup topic area, is to
PAQ, refund points (a little progress, but ultimately unanswered).
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
My recommendation, which I will post in the Cleanup topic area, is to
PAQ, refund points (a little progress, but ultimately unanswered).
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
xabi