?
Solved

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

Posted on 2010-11-15
8
Medium Priority
?
352 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

762 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