FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » ImageMagick - Possible to return image as an object?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
ImageMagick - Possible to return image as an object? [message #174299] Tue, 31 May 2011 18:43 Go to next message
BigNate is currently offline  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 Go to previous messageGo to next message
Denis McMahon is currently offline  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 Go to previous messageGo to next message
Luuk is currently offline  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 Go to previous messageGo to next message
Luuk is currently offline  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 Go to previous messageGo to next message
BigNate is currently offline  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 #174307 is a reply to message #174299] Wed, 01 June 2011 20:22 Go to previous messageGo to next message
BigNate is currently offline  BigNate
Messages: 7
Registered: February 2011
Karma: 0
Junior Member
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!
Re: ImageMagick - Possible to return image as an object? [message #174309 is a reply to message #174307] Thu, 02 June 2011 09:07 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: ImageMagick - Possible to return image as an object? [message #174310 is a reply to message #174309] Thu, 02 June 2011 09:18 Go to previous messageGo to next message
Erwin Moller is currently offline  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
Re: ImageMagick - Possible to return image as an object? [message #174311 is a reply to message #174310] Thu, 02 June 2011 14:18 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 02/06/2011 11:18, Erwin Moller escribió/wrote:
> 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've just browsed the web site and you are right:

https://groups.google.com/forum/#!topic/comp.lang.php/JV7G_GMvQ2M

:-?


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: ImageMagick - Possible to return image as an object? [message #174312 is a reply to message #174311] Thu, 02 June 2011 16:01 Go to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 02-06-2011 16:18, "Álvaro G. Vicario" wrote:
> El 02/06/2011 11:18, Erwin Moller escribió/wrote:
>> 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've just browsed the web site and you are right:
>
> https://groups.google.com/forum/#!topic/comp.lang.php/JV7G_GMvQ2M
>
> :-?
>
>

or
http://groups.google.com/group/comp.lang.php/browse_frm/thread/255ec6fc632f 4363?hl=nl#
?

--
Luuk
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PHP Programmers for PHP Web Development
Next Topic: how to parse url?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 14:54:08 GMT 2024

Total time taken to generate the page: 0.02433 seconds