Hi,
I found this forum in a frantic rush to try and finally solve the problem I have.
I am trying to crop an image using Imagemagick: http://pastebin.com/1ZKgHWLk
The code I have written to do this: http://pastebin.com/Cr7qDj3J does everything & crops the image BUT it outputs a black image.
I have tried everything to try and resolve. Im sure it's something simple BUT I can't figure out what it is.
Does anyone have any ideas?
Thanks!
cropping problems
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: cropping problems
Perhaps you need to remove the virtual canvas after cropping. See http://us3.php.net/manual/en/function.i ... gepage.php
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: cropping problems
If I read it correctly, you aren't loading the image into memory. load_image only pings the image. You should use _load_image
Pete
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: cropping problems
Thanks guys for replying.
Pete, I thought the same and tried _load_image but when I do use this it throws an error: Resource Id: ... does not exist
Any ideas? The absolute file path it references does seem to be correct.
Thanks for your help.
Pete, I thought the same and tried _load_image but when I do use this it throws an error: Resource Id: ... does not exist
Any ideas? The absolute file path it references does seem to be correct.
Thanks for your help.
Re: cropping problems
Start simple, get it working and then add all the posts etc.
Code: Select all
<?php
$im = new imagick( "input.jpg" );
$im->cropImage( 100, 100, 50, 50 );
$im->writeImage( "thumbnail.jpg" );
?>
<img src="th_80x80_test.png">
Re: cropping problems
Thanks
I don't know what I decided to use a custom class.
The code you offered is fine. A problem out the way.
Thanks again.
I don't know what I decided to use a custom class.
The code you offered is fine. A problem out the way.
Thanks again.