PHP and Image processing

This is a discussion on PHP and Image processing within the PHP Language forums, part of the PHP Programming Forums category; Hello group, Few weeks ago, somebody suggested me to use Imagick for image manipulation/processing. I installed it and now ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008
amit
 
Posts: n/a
Default PHP and Image processing



Hello group,


Few weeks ago, somebody suggested me to use Imagick for image
manipulation/processing. I installed it and now want to start learning
it so I did start with an example but what other steps should I take
after installation?
As you know better I need to instantiate an object from a class but
there is no any include file to add the library to my project!

Can somebody please give me some hints on this?


Thanks,
Amit
Reply With Quote
  #2 (permalink)  
Old 04-17-2008
Krustov
 
Posts: n/a
Default Re: PHP and Image processing

<comp.lang.php>
<amit>
<Thu, 17 Apr 2008 13:25:49 -0700 (PDT)>
<bd5b3af9-74e7-4df5-b742-ab8ea73c949d@k13g2000hse.googlegroups.com>

> Hello group,
>
>
> Few weeks ago, somebody suggested me to use Imagick for image
> manipulation/processing. I installed it and now want to start learning
> it so I did start with an example but what other steps should I take
> after installation?
> As you know better I need to instantiate an object from a class but
> there is no any include file to add the library to my project!
>
> Can somebody please give me some hints on this?
>


When i posted some code the other week to help you - the only thing you
did was critisise the way i named some variables - and to say you got a
division by zero .

While the slagging of the variable names i can accept - but its clear
you didnt actually even try the code before before altering it .

IMHO if you alter the code before even trying it to see if it worked or
not - then you are a idiot .

For if you had bothered to actually ask - then i would have told you
that you needed to change another part of the code if you changed the
maximum width/height dimentions of the thumbnail .

= you are a idiot who thinks they know everything but still asks for
help in how to do stuff .


--
www.krustov.co.uk
Reply With Quote
  #3 (permalink)  
Old 04-18-2008
amit
 
Posts: n/a
Default Re: PHP and Image processing

On Apr 17, 3:06*pm, Krustov <m...@privacy.net> wrote:
> <comp.lang.php>
> <amit>
> <Thu, 17 Apr 2008 13:25:49 -0700 (PDT)>
> <bd5b3af9-74e7-4df5-b742-ab8ea73c9...@k13g2000hse.googlegroups.com>
>
> > Hello group,

>
> > Few weeks ago, somebody suggested me to use Imagick for image
> > manipulation/processing. I installed it and now want to start learning
> > it so I did start with an example but what other steps should I take
> > after installation?
> > As you know better I need to instantiate an object from a class but
> > there is no any include file to add the library to my project!

>
> > Can somebody please give me some hints on this?

>
> When i posted some code the other week to help you - the only thing you
> did was critisise the way i named some variables - and to say you got a
> division by zero .
>
> While the slagging of the variable names i can accept - but its clear
> you didnt actually even try the code before before altering it .
>
> IMHO if you alter the code before even trying it to see if it worked or
> not - then you are a idiot .
>
> For if you had bothered to actually ask - then i would have told you
> that you needed to change another part of the code if you changed the
> maximum width/height dimentions of the thumbnail .
>
> = you are a idiot who thinks they know everything but still asks for
> help in how to do stuff .
>
> --www.krustov.co.uk



Hi Krustov,

I don't what you are mad about but this is what I found in that post.
I totally don't understand what part of it was critisizing you. Check
it out:

>Thank you but it is so confusing the way it is written in terms of
>variable names. Also, I get so many division by zero.


The reason I didn't touch the code beacuse I just started learning PHP
in few weeks and didn't want to mess with the code since I don't know
everything. Do you change code before you learn or understand it?

BTW, did I use any bad names or did I insult you?!! I just said I'm
getting division by zero and did thank you in advance and I didin't
criticised you or your code!

However, I personally don't consider a PHP forum as a place to insult
people either they deserve it or not. BUT that's OK. Let's forget that
and again I thank you for your help in that post again. Good luck and
if you think I have attached you then I apologize you.

so let it go!!!




Reply With Quote
  #4 (permalink)  
Old 04-18-2008
Tim Roberts
 
Posts: n/a
Default Re: PHP and Image processing

amit <amit.kohan@gmail.com> wrote:
>
>Few weeks ago, somebody suggested me to use Imagick for image
>manipulation/processing. I installed it and now want to start learning
>it so I did start with an example but what other steps should I take
>after installation?
>As you know better I need to instantiate an object from a class but
>there is no any include file to add the library to my project!


It's a native extension. That means the class is available without having
to import anything, just like the other extensions (for example, Postgres
or MySQL).

Didn't you look at ANY of the examples in the documentation? That's what
they're there for.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Reply With Quote
  #5 (permalink)  
Old 04-18-2008
Piotr
 
Posts: n/a
Default Re: PHP and Image processing

Tim Roberts wrote:
> It's a native extension. That means the class is available without having
> to import anything, just like the other extensions (for example, Postgres
> or MySQL).


Afaik, it's native from php 5.1.3.
Also, it's still marked as experimental, and I'm not sure if it's
bundled with windows version. Manual mentions the need to download
binaries from imagemagic.org

to Amit:
After you download the extension binaries. Put the dll into your
extensions direcotry, and make sure your php.ini files has following line:
extension=php_imagick.dll

best regards
Piotr N
Reply With Quote
  #6 (permalink)  
Old 04-21-2008
amit
 
Posts: n/a
Default Re: PHP and Image processing

On Apr 18, 4:10*am, Piotr <s...@poczta.onet.pl> wrote:
> Tim Roberts wrote:
> > It's a native extension. *That means the class is available without having
> > to import anything, just like the other extensions (for example, Postgres
> > or MySQL).

>
> Afaik, it's native from php 5.1.3.
> Also, it's still marked as experimental, and I'm not sure if it's
> bundled with windows version. Manual mentions the need to download
> binaries from imagemagic.org
>
> to Amit:
> After you download the extension binaries. Put the dll into your
> extensions direcotry, and make sure your php.ini files has following line:
> extension=php_imagick.dll
>
> best regards
> Piotr N



Hello Tim and Piotr,

Thanks for your response but I am not using Windows server instead
using using Linux which as far as I know it doesn't have dll file. Or
maybe the file you are taking about works for Linux as well. I'm new
to PHP and not familiar with these steps.

Ok, what I did was installing it from http://www.imagemagick.org/script/install-source.php
Then I followed all steps which finally after verification it was able
to create a GIF file. Now, I don't know how to include it in my code.
Once I tried to run it and PHP was complaining about new() operator.

Any advice is appreciated.

Regards.




Reply With Quote
  #7 (permalink)  
Old 04-21-2008
Piotr
 
Posts: n/a
Default Re: PHP and Image processing

amit wrote:

> Ok, what I did was installing it from http://www.imagemagick.org/script/install-source.php
> Then I followed all steps which finally after verification it was able
> to create a GIF file. Now, I don't know how to include it in my code.
> Once I tried to run it and PHP was complaining about new() operator.
>
> Any advice is appreciated.



Link you provided refers to ImageMagic alone, what you need to do,
is to add imagemagic extension to your PHP. Easiest way to do that,
will be to launch your system packed manager (software installation
tool) and search for php and imagemagic. You should find packed that
provides that. Most popular distributions should provide that. Although
you might need additional repositories. You can also seek for a packed
in google and download and install it.

You might also try using PECL installer to add imagick,
to do so, issue:
pecl install imagick
Note that you might need to be root to complete the installation.

If you have PHP > 5.1.3, then needed extension might already be present.
To check it, issue in your console:
php -i |grep imagick
If you get some data, then it's present.


Once the extension is loaded, you can simply use it's functions and
objects. You need not 'import' or 'include' anything.

Here is PHP image magic function reference:
http://pl.php.net/manual/pl/book.imagick.php

PS. Keep in mind, that most hosting companies do not provide this
extension. Another image library, called GD is usually compiled into PHP
and available on most hosting servers.

best regards
Piotr N
Reply With Quote
  #8 (permalink)  
Old 04-22-2008
amit
 
Posts: n/a
Default Re: PHP and Image processing

On Apr 21, 2:13*pm, Piotr <s...@poczta.onet.pl> wrote:
> amit wrote:
> > Ok, what I did was installing it fromhttp://www.imagemagick.org/script/install-source.php
> > Then I followed all steps which finally after verification it was able
> > to create a GIF file. Now, I don't know how to include it in my code.
> > Once I tried to run it andPHPwas complaining about new() operator.

>
> > Any advice is appreciated.

>
> Link you provided refers to ImageMagic alone, what you need to do,
> is to add imagemagic extension to yourPHP. Easiest way to do that,
> will be to launch your system packed manager (software installation
> tool) and search for *phpand imagemagic. You should find packed that
> provides that. Most popular distributions should provide that. Although
> you might need additional repositories. You can also seek for a packed
> in google and download and install it.
>
> You might also try using PECL installer to add imagick,
> to do so, issue:
> pecl install imagick
> Note that you might need to be root to complete the installation.
>
> If you havePHP> 5.1.3, then needed extension might already be present.
> To check it, issue in your console:php-i |grep imagick
> If you get some data, then it's present.
>
> Once the extension is loaded, you can simply use it's functions and
> objects. You need not 'import' or 'include' anything.
>
> Here isPHPimagemagic function reference:http://pl.php.net/manual/pl/book.imagick.php
>
> PS. Keep in mind, that most hosting companies do not provide this
> extension. Anotherimagelibrary, called GD is usually compiled intoPHP
> and available on most hosting servers.
>
> best regards
> Piotr N



Hi Piotr,

Thank you so much for your the information.
1) Are you saying that I only have installed Image_Magick but must add
its PHP extension as well?
2) Is this a good place to install it? (http://php.net/manual/en/
install.pecl.php)
3) and then the extension from http://pecl.php.net/package/imagick ?

Please let me know this .


All the best,
Amit




Reply With Quote
  #9 (permalink)  
Old 04-22-2008
amit
 
Posts: n/a
Default Re: PHP and Image processing

On Apr 22, 10:49*am, amit <amit.ko...@gmail.com> wrote:
> On Apr 21, 2:13*pm, Piotr <s...@poczta.onet.pl> wrote:
>
>
>
>
>
> > amit wrote:
> > > Ok, what I did was installing it fromhttp://www.imagemagick.org/script/install-source.php
> > > Then I followed all steps which finally after verification it was able
> > > to create a GIF file. Now, I don't know how to include it in my code.
> > > Once I tried to run it andPHPwas complaining about new() operator.

>
> > > Any advice is appreciated.

>
> > Link you provided refers to ImageMagic alone, what you need to do,
> > is to add imagemagic extension to yourPHP. Easiest way to do that,
> > will be to launch your system packed manager (software installation
> > tool) and search for *phpand imagemagic. You should find packed that
> > provides that. Most popular distributions should provide that. Although
> > you might need additional repositories. You can also seek for a packed
> > in google and download and install it.

>
> > You might also try using PECL installer to add imagick,
> > to do so, issue:
> > pecl install imagick
> > Note that you might need to be root to complete the installation.

>
> > If you havePHP> 5.1.3, then needed extension might already be present.
> > To check it, issue in your console:php-i |grep imagick
> > If you get some data, then it's present.

>
> > Once the extension is loaded, you can simply use it's functions and
> > objects. You need not 'import' or 'include' anything.

>
> > Here isPHPimagemagic function reference:http://pl.php.net/manual/pl/book..imagick.php

>
> > PS. Keep in mind, that most hosting companies do not provide this
> > extension. Anotherimagelibrary, called GD is usually compiled intoPHP
> > and available on most hosting servers.

>
> > best regards
> > Piotr N

>
> Hi Piotr,
>
> Thank you so much for your the information.
> 1) Are you saying that I only have installed Image_Magick but must add
> itsPHPextension as well?
> 2) Is this a good place to install it? (http://php.net/manual/en/
> install.pecl.php)
> 3) and *then the extension fromhttp://pecl.php.net/package/imagick?
>
> Please let me know this .
>
> All the best,
> Amit- Hide quoted text -
>
> - Show quoted text -



Also, when I run:

pecl install imagick


I get: -bash: pecl: command not found

so I guess I have to install pecl as well.


Thanks.

Reply With Quote
  #10 (permalink)  
Old 04-23-2008
The Natural Philosopher
 
Posts: n/a
Default Re: PHP and Image processing

amit wrote:
> On Apr 22, 10:49 am, amit <amit.ko...@gmail.com> wrote:
>> On Apr 21, 2:13 pm, Piotr <s...@poczta.onet.pl> wrote:
>>
>>
>>
>>
>>
>>> amit wrote:
>>>> Ok, what I did was installing it fromhttp://www.imagemagick.org/script/install-source.php
>>>> Then I followed all steps which finally after verification it was able
>>>> to create a GIF file. Now, I don't know how to include it in my code.
>>>> Once I tried to run it andPHPwas complaining about new() operator.
>>>> Any advice is appreciated.
>>> Link you provided refers to ImageMagic alone, what you need to do,
>>> is to add imagemagic extension to yourPHP. Easiest way to do that,
>>> will be to launch your system packed manager (software installation
>>> tool) and search for phpand imagemagic. You should find packed that
>>> provides that. Most popular distributions should provide that. Although
>>> you might need additional repositories. You can also seek for a packed
>>> in google and download and install it.
>>> You might also try using PECL installer to add imagick,
>>> to do so, issue:
>>> pecl install imagick
>>> Note that you might need to be root to complete the installation.
>>> If you havePHP> 5.1.3, then needed extension might already be present.
>>> To check it, issue in your console:php-i |grep imagick
>>> If you get some data, then it's present.
>>> Once the extension is loaded, you can simply use it's functions and
>>> objects. You need not 'import' or 'include' anything.
>>> Here isPHPimagemagic function reference:http://pl.php.net/manual/pl/book.imagick.php
>>> PS. Keep in mind, that most hosting companies do not provide this
>>> extension. Anotherimagelibrary, called GD is usually compiled intoPHP
>>> and available on most hosting servers.
>>> best regards
>>> Piotr N

>> Hi Piotr,
>>
>> Thank you so much for your the information.
>> 1) Are you saying that I only have installed Image_Magick but must add
>> itsPHPextension as well?
>> 2) Is this a good place to install it? (http://php.net/manual/en/
>> install.pecl.php)
>> 3) and then the extension fromhttp://pecl.php.net/package/imagick?
>>
>> Please let me know this .
>>
>> All the best,
>> Amit- Hide quoted text -
>>
>> - Show quoted text -

>
>
> Also, when I run:
>
> pecl install imagick
>
>
> I get: -bash: pecl: command not found
>
> so I guess I have to install pecl as well.
>
>
> Thanks.
>

the pain doesn't stop there.

I gave up on ImageMagick and found a smaller library that did all I needed.


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:48 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0