ImageMagick - Possible to return image as an object? [message #174299] |
Tue, 31 May 2011 18:43 |
BigNate
Messages: 7 Registered: February 2011
Karma: 0
|
Junior Member |
|
|
Hi folks
I've got ImageMagick working and generating the images I need by using the exec() command and writing the images to a directory. The problem is, my boss now wants them returned as an object and not actually writing anything to the server. Does anyone know how to do this? I'm still learning about OOP so any help would be greatly appreciated.
Thanks!
Nate
|
|
|
Re: ImageMagick - Possible to return image as an object? [message #174300 is a reply to message #174299] |
Tue, 31 May 2011 19:08 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Tue, 31 May 2011 11:43:18 -0700, BigNate wrote:
> Hi folks
> I've got ImageMagick working and generating the images I need by using
> the exec() command and writing the images to a directory. The problem
> is, my boss now wants them returned as an object and not actually
> writing anything to the server. Does anyone know how to do this? I'm
> still learning about OOP so any help would be greatly appreciated.
<http://www.imagemagick.org/script/api.php?
ImageMagick=q7a4c570970og4suf71lvvk917#php>
I think you need to use one of these interfaces for php to ImageMagick,
or roll your own.
I have no experience of using this method myself, but hopefully at least
one of them will have docs and examples.
Rgds
Denis McMahon
|
|
|
Re: ImageMagick - Possible to return image as an object? [message #174301 is a reply to message #174299] |
Tue, 31 May 2011 19:09 |
Luuk
Messages: 329 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 31-05-2011 20:43, BigNate wrote:
> Hi folks
> I've got ImageMagick working and generating the images I need by using the exec() command and writing the images to a directory. The problem is, my boss now wants them returned as an object and not actually writing anything to the server. Does anyone know how to do this? I'm still learning about OOP so any help would be greatly appreciated.
>
> Thanks!
>
> Nate
<?php
header('Content-type: image/gif');
exec('imageMacick.....');
$file = file_get_contents('image.gif');
echo $file;
?>
--
Luuk
|
|
|
Re: ImageMagick - Possible to return image as an object? [message #174302 is a reply to message #174301] |
Tue, 31 May 2011 19:13 |
Luuk
Messages: 329 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 31-05-2011 21:09, Luuk wrote:
> On 31-05-2011 20:43, BigNate wrote:
>> Hi folks
>> I've got ImageMagick working and generating the images I need by using the exec() command and writing the images to a directory. The problem is, my boss now wants them returned as an object and not actually writing anything to the server. Does anyone know how to do this? I'm still learning about OOP so any help would be greatly appreciated.
>>
>> Thanks!
>>
>> Nate
>
> <?php
> header('Content-type: image/gif');
> exec('imageMacick.....');
> $file = file_get_contents('image.gif');
> echo $file;
> ?>
>
or,
http://www.php.net/imagick
--
Luuk
|
|
|
Re: ImageMagick - Possible to return image as an object? [message #174303 is a reply to message #174299] |
Tue, 31 May 2011 20:39 |
BigNate
Messages: 7 Registered: February 2011
Karma: 0
|
Junior Member |
|
|
Thanks guys. I've looked into Imagick and would like to avoid rewriting everything I've got so far. If I can't get it to work soon, I will go that route.
Luuk, your first suggestion is fine, but I am writing the image files during my exec() calls and then returning the path & filename of the final image:
exec( "convert $this->arrow -background transparent -rotate $degree $this->temp_arrow" );
where $this->arrow is the original image already on the server and $this->temp_arrow is written to the server.
If I could set the new file as an object and still manipulate it with other exec() calls, that would be ideal, and then just return the object from the function.
|
|
|
|
|
Re: ImageMagick - Possible to return image as an object? [message #174310 is a reply to message #174309] |
Thu, 02 June 2011 09:18 |
Erwin Moller
Messages: 228 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/2/2011 11:07 AM, "Álvaro G. Vicario" wrote:
> El 01/06/2011 22:22, BigNate escribió/wrote:
>> Update:
>>
>> So I ended up rewriting what I had using the Imagick class and it
>> came out just as good as using exec(), if not better. Thanks for
>> your suggestions!
>
> Please try to post your replies as actual replies rather than new
> messages. Otherwise, it's hard to know what you are talking about.
>
>
Álvaro,
He is one of thoose GG users. In their view (gg) he IS posting in the
right place because in gg it appears right.
Message-ID:
<a1a548ec-8c24-42fb-a840-ba46b3956f34(at)glegroupsg2000goo(dot)googlegroups(dot)com>
I understand that the 'version2' of the new-improved-super-duper-user
interface does that, as a service to all normal regular usenetizens. :-(
And yes, I consider it highly annoying too. You guessed. ;-)
Regards,
Erwin Moller
--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
|
|
|
|
|