Solved

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

Posted on 2010-11-15
8
336 Views
Last Modified: 2013-11-08
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
Comment
Question by:haloexpertsexchange
  • 5
  • 2
8 Comments
 
LVL 2

Expert Comment

by:gtagliani
ID: 34140214
if the original image fits in 80x60 it will not resize it.
0
 
LVL 13

Author Comment

by:haloexpertsexchange
ID: 34140248
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
 
LVL 2

Expert Comment

by:gtagliani
ID: 34140397
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Author Comment

by:haloexpertsexchange
ID: 34140411
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
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 34143739
@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
 
LVL 13

Author Comment

by:haloexpertsexchange
ID: 34158303
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
 
LVL 13

Accepted Solution

by:
haloexpertsexchange earned 0 total points
ID: 35690796
Never found an answer to my question, I have since moved on and worked around the problem.
0
 
LVL 13

Author Closing Comment

by:haloexpertsexchange
ID: 35718397
no answer found
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question