Page 1 of 1

Re: Problem using convert

Posted: 2008-07-27T19:12:34-07:00
by fmw42
there is no such image format that I know of with the suffix .tmp

If you want to create a temporary image, there are multiple ways to do so using other IM formats such as miff, mpc and mpr

see http://www.imagemagick.org/Usage/files/

Re: Problem using convert

Posted: 2008-07-28T04:23:06-07:00
by anthony
If you really need a .tmp suffix, you will need to specify the image format as a prefix

Code: Select all

   convert .... miff:C:\gallery2_data\tmp\img1732.tmp
The IM default otherwise would be to use the format that was read, if posible, otherwise it will save as MIFF (the internal Magick Image File Format).

What you should use format depends on how you plan to use the image, as every image format as its pro's and con's. See IM Examples, File Handling (for the special MIFF and MPC formats), and Common File Formats (for GIF, PNG, and JPEG etc)

Also it is better to read the image BEFORE operating on it (using -geometry).

Finally -geometry is a very special operator in IM and only really of use in Image Composition, to set the images composition offset. For image resizing it is recommended you use -resize, or -thumbnail.

For more information about thing, see IM Examples (see signature). You can use the 'Reference' page to find information about specific options quickly.

Re: Problem using convert

Posted: 2008-07-29T00:55:19-07:00
by virshu
I think the anthony's advise is somewhat misdirected. The first poster is using Gallery2 (and not IM directly) that generates the command that is described there:

Code: Select all

convert.exe  -size 200x200  -geometry  200x200 test.gif imgE5B7.tmp
This command works perfectly fine in IM 6.3.5 but is producing an error IM 6.4.2. She probably knows that there is no image format with suffix .tmp; and if she doesn't - she doesn't care. She wants to use Gallery2 that instructed her to download ImageMagick, and she followed instructions, and she got a problem.

One (probably pointless) question is, what was the reason to break backward compatibility? And corollary to that - is there any place where such things are documented. Gallery relies on IM quite heavily, and it would be most unfortunate if users find such problems through trial and error...

Another, more practical, question - is it possible to post old version for download. This way, until this issue is resolved, Gallery developers could post a note instructing the users to download version 6.3, and not 6.4, which is incompatible with Gallery

Re: Problem using convert

Posted: 2008-07-29T15:36:25-07:00
by fmw42
I know nothing about Gallery. But it would have been prudent for the Gallery people to be on top of IM if they are recommending its use.

With regard to command line syntax, this is explained in detail at http://www.imagemagick.org/Usage/basics/#cmdline

Re: Problem using convert

Posted: 2008-07-29T16:49:41-07:00
by virshu
fmw42 wrote:I know nothing about Gallery. But it would have been prudent for the Gallery people to be on top of IM if they are recommending its use.
And we are. There is already a bug open to fix it.
fmw42 wrote:With regard to command line syntax, this is explained in detail at http://www.imagemagick.org/Usage/basics/#cmdline
I didn't find anything in this link that makes the current syntax

Code: Select all

convert.exe  -size 200x200  -geometry  200x200 test.gif imgE5B7.tmp
illegal. Not to mention that it worked fine in 6.3.

That said, we don't need to agree whether it's Gallery's invocation bug, or IM implementation bug. Let's say it's both. What I am asking is to make 6.3 available, so that Gallery users can download the IM version that is compatible, namely 6.3

Thanks in advance

Re: Problem using convert

Posted: 2008-07-29T18:40:53-07:00
by anthony
Older versions are available from the source forge site.
http://sourceforge.net/project/showfile ... p_id=24099
Go to the link about 'older releases'.

Re: Problem using convert

Posted: 2008-07-29T18:41:21-07:00
by fmw42
Did you see the section: http://www.imagemagick.org/Usage/basics/#legacy

That has the only explanation of legacy style vs IM 6 style convert that I am aware of and there are warnings that things may not work properly. I do not know whether your specific command falls into that category or not or if something else has changed in IM since 6.3.

As to making IM 6.3 available, I have to leave that to the folks at IM.

Re: Problem using convert

Posted: 2008-07-29T18:51:21-07:00
by anthony
And IM v7 (when that project starts) may not support legacy style, as it currently requires IM to parse the command line TWICE, and prevents the future creation of 'convert' scripts, where convert options are read from a file, rather than the command line.

Basically legacy style is a current 'limitation' to IM's development.

However legacy style is NOT the problem you are having.


The original problem is that you do not define what image format '.tmp' is meant to be, but are assuming that it is the same as the input image format.

Presumably something had changed that causes '.tmp' suffix to override the 'keep old format' handling that you are relying on (and should NOT be relying on).

An alternative 'fix' is to create an personal output 'delegate' that tells IM what to do to create a 'tmp' image file format. But this should be personal (for your specific case) and not general.

here is an untested ".magick/delegates.xml" file.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<delegatemap>
  <delegate decode=gif encode="tmp" command='mv "%i" "%o"'/>
</delegatemap>
With this file in place Im now understands how to create a GIF 'tmp' files, and your original command will work!

Code: Select all

   convert  -size 200x200  -geometry 200x200 image.gif image.tmp
Do not add the delegate to the 'system' delegates.xml file, or it will 'disappear' when your IM is upgraded.


The above 'solution' has been added to the updated 'delegates' section of IM examples, and will appear in a day to two.
http://www.imagemagick.org/Usage/files/#delegates

Re: Problem using convert

Posted: 2008-07-29T19:20:32-07:00
by virshu
Folks, thanks all for the quick replies.
  • I understand the point about legacy format vs. deprecated in v.6 vs removed in v.7. However, it is not relevant to the issue at hand. the non-legacy format

    Code: Select all

    convert.exe test.gif -size 200x200 -geometry 200x200 test3.tmp
    has the same problem (works in 6.3, doesn't work in 6.4)
  • We were pointing to IM download page; not to SourceForge. We will make a note about the incompatibility and recommend to use 6.3 in the meantime
  • We will change the generated command line before the next release. Fortunately, the problem only exhibits in Windows. PHP tempnam() function generates test3.tmp on Windows, but temp3 (without any extension) on Linux, and IM doesn't have a problem with

    Code: Select all

    convert test.gif -size 200x200 -geometry 200x200 test3
    (at least, not now).
If you find other incompatibilities with previous versions, I would strongly encourage you to publicize them more conspicuously.

Re: Problem using convert

Posted: 2008-07-29T20:15:20-07:00
by el_supremo
virshu wrote:

Code: Select all

convert.exe  -size 200x200  -geometry  200x200 test.gif imgE5B7.tmp
This command works perfectly fine in IM 6.3.5 but is producing an error IM 6.4.2.
Do you have an example of a .tmp file produced like that on 6.3.5? If so, could you run the command:

Code: Select all

identify example.tmp
and let us know what it outputs?

Pete

Re: Problem using convert

Posted: 2008-07-30T08:08:55-07:00
by virshu
The IM 6.4 - compatible version will be released as part of Gallery 2.3 RC-2 (due in a week or so), or you can get it from nightly build tomorrow