com and JPEG2000 (jp2)

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
leww

com and JPEG2000 (jp2)

Post by leww »

I have an installation where
convert sourcefile.jpg targetfile.jp2
works from the command line and various other converts (change size, create PDF) work from and to the appropriate directories, but
Dim img
source = "sourcefile.jpg"
target = "targetfile.jp2"
Set img = CreateObject("ImageMagickObject.MagickImage.1")
msg = img.Convert(source , target )
fails quietly.

Can you do a JPEG2000/jp2 conversion from the COM interface?
leww

Re: com and JPEG2000 (jp2)

Post by leww »

Further clarification and possible bug alert:
using IM 6.3.9-Q8 on a Windows 2003 server
Source file: JPEG, 8 bit colour, 5856 x 7432 (w x h), 8,212480 bytes

msg = img.Convert(strUploadFile, "-resize", "1532", "-colorspace", "rgb", strPermanentFile)
works where strUploadFile points to the source file and strPermantFile points to the target file

... if resize is set to 1532 or less

This happens to yield a target file of less than 1,000,000 bytes.
Setting Quality to 50 returned a 212,992 byte file, but the width could be no larger.

Making the resize value a width of "1533" or larger yields a zero length file.

Converting to a PDF
img.Convert(strUploadFilePath, "-quality","70", "-colorspace", "rgb", strPermanentFileName)
yields a 5.9 Mb file with no hesitation.

The challenge is that I also need a JPEG 2000 / JP2 file and one that preferably is not downsized.

Notes:
A) running AspExec yields exactly the same problems, (i.e. generates PDF in all circumstances; fails to generate JP2 if resize is over 1532 wide)
B) running from the command window yields an full sized file of several megabytes
Post Reply