[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 DeverloperCommented:
@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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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