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

Posted on 2010-11-15
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.
Question by:haloexpertsexchange
  • 5
  • 2

Expert Comment

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

Author Comment

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.

Expert Comment

ID: 34140397
try with this:

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

im not sure if convert is a Imagick function.
LVL 13

Author Comment

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.
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

LVL 40

Expert Comment

ID: 34143739
@gtagliani, see (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?
LVL 13

Author Comment

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);
LVL 13

Accepted Solution

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

Author Closing Comment

ID: 35718397
no answer found

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now