Solved

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

Posted on 2010-11-15
8
330 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 40

Expert Comment

by:RQuadling
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

910 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

29 Experts available now in Live!

Get 1:1 Help Now