I was trying to put "convert -format jpg" in the command line box. It gives no error messages, but still doesn't want to convert my png files to jpg.

I did installed the dev snapshot of imageAPI module from 11 august :)

Any tips to help me get the converted images in jpg format would be appreciated.

Thanks in advance.

Comments

adrinux’s picture

You just need the command line options, convert is called by imageapi, so drop convert and try:

"-format jpg"

adrinux’s picture

Status: Active » Closed (fixed)

Also look at "admin/settings/imageapi/config" and see if you have 'Display debugging information' checked, if you'd seen the error messages it would have been obvious what was going wrong :)

Closing this, open it again if you still have problems.

nbayaman’s picture

Status: Closed (fixed) » Active

Thanks guys for your answers, but i still got the problem.

Here is the IM options i have put. The first one works as it should, but the "-format jpg" does nothing, the resulting thumbnail image still turns out as png file...

IM raw	-thumbnail 240x120\> -unsharp 0x.5 \( -clone 0 -resize 240x120 +level 20%x100% -blur 0x3 \) \( -clone 0 \) -delete 0 -gravity center -composite	
	
IM raw	-format jpg

And i turned on debugging mode, still no error... any mysticism here? :)

adrinux’s picture

Error messages: you might need devel module installed too. And often the error doesn't seem to appear until you refresh or visit another page. hth

Keep in mind that imageapi smooshes all these actions together and adds the quality setting when calling convert, so the final command would be something like:

convert inputfile.name -thumbnail 240x120\> -unsharp 0x.5 \( -clone 0 -resize 240x120 +level 20%x100% -blur 0x3 \) \( -clone 0 \) -delete 0 -gravity center -composite -format jpg -quality 80 outputfile.name

Which prompts several thoughts:

  1. If that doesn't work on the command line, it's not going to work in the context of drupal either*
  2. I can't remember what imageapi/imagecache does for the outputfile name - I've a suspicion you're outputting a jpg with a png file extension (in fact I have vague memories of reading something about that in the imageapi/imagecache documentation). I suggest taking a closer look at your output file.

* I consider this a feature, get your transformations working on the command line, then shift them into drupal.

adrinux’s picture

Status: Active » Closed (fixed)

As per 2. above, I think this problem is nothing to do with im_raw module as such. Closing.

nbayaman’s picture

Version: 5.x-1.0 » 6.x-1.2

Hi guys.

I ported my site to 6th Drupal, and again found a will to change the image formats (due IE bugging with png files). And followed #2, and i would say that convert changes format only in that case if I explicitly point the output file's format i.e.: convert inputfile.png -format jpg outputfile.jpg, and this is indeed an image in JPEG format.

So i'm here again, to find out, how does this module handles filenames? Is there any chance that -format option has any deal with output filename?

Thanks :)

adrinux’s picture

So i'm here again, to find out, how does this module handles filenames? Is there any chance that -format option has any deal with output filename?
In short im_raw doesn't handle file names. That's all dealt with by imageAPI.

See http://api.freestylesystems.co.uk/api/file/contributions/imageapi/imagea...

and also note that other people have problems and are looking for solutions:
http://drupal.org/node/375218

Basically the act of opening and closing a file is dealt with by imageAPI as is the name of the input and output files.

im_raw is is dependent on imagecache and imageAPI, such that anything you put in an im_raw action is fed through those modules:
filesystem < imageAPI < imagecache < im_raw

Entering format and output file names as an im_raw action probably results in them being passed to imagemagick, and imagemagick may well process them without errors (they are legitimate commands after all!), but that doesn't mean drupal and imageapi know what imagemagick has been doing, and where or what the output file is. The problem needs to be fixed at the level of imageAPI.

Please file a support issue in the imageAPI queue, and reference this thread, maybe someone can explain it more clearly there.

nbayaman’s picture

Status: Closed (fixed) » Closed (works as designed)

Thanks mate!