• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Why does my imagemagick com object only re-size my images sometimes?

Why does the imagemagick object only re-size my images some of the time?
$img = $com_IM->Convert($Logo,'-background','white','-layers','-merge','-flatten','-resize','80x60',$newImage);
This works some times. I can not seem to narrow it down to a specific image format, nor image size. The extra commands do not seem to affect it either since they seem to run all the time.
I can not tell if there is something that I am doing wrong which is cropping up from time to time but it does not seem to have any set pattern of not working.
0
haloexpertsexchange
Asked:
haloexpertsexchange
  • 5
  • 2
1 Solution
 
gtaglianiCommented:
if the original image fits in 80x60 it will not resize it.
0
 
haloexpertsexchangeAuthor Commented:
Unfortunately that is not the issue here, I do not care about images that are smaller than the requested dimensions, just the ones that are larger.
0
 
gtaglianiCommented:
try with this:

$image = new Imagick('image.jpg');
$image->scaleImage(80, 60, true);

im not sure if convert is a Imagick function. http://php.net/manual/en/book.imagick.php
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
haloexpertsexchangeAuthor Commented:
I could not get imagick to ever work for me, every time I tried using it, fastcgi would crash so what I am using now is the imagemagick object, which is a com object connection to imagemagick.
0
 
Richard QuadlingSenior Software DeveloperCommented:
@gtagliani, see http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ImageMagick/Q_26590266.html (PHP is a different version to the pre-compiled extension).

@haloexpertsexchange, As a test does it behave consistently for the same image? If so, can you provide a working and non-working image please. That way, we can evaluate the actual actions.

Out of interest, does it work if you use the command line for ImageMagick?
0
 
haloexpertsexchangeAuthor Commented:
I have not been able to find an image that it consistantly works, or does not work for. An image that I could run through fine yesterday is not working correctly today.
The commands will run through the command line as normal ImageMagick commands with one small change, $img = $com_IM->Convert($Logo,'-background','white','-layers','merge','-flatten','-resize','80x60',$newImage);
0
 
haloexpertsexchangeAuthor Commented:
Never found an answer to my question, I have since moved on and worked around the problem.
0
 
haloexpertsexchangeAuthor Commented:
no answer found
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now