Re: POW: ImageMagick multipurpose graphic importer


Subject: Re: POW: ImageMagick multipurpose graphic importer
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Thu Jul 26 2001 - 23:38:11 CDT


On Fri, 27 Jul 2001, Joerg Baumann wrote:

> Hi,
>
> this is my first post to this list. I wanted to start working on abiword
> (so I can contribute just a little bit to your great work ;-) and I
> thought the POW "ImageMagick multipurpose graphic importer" would be
> a good start. But nearly a month ago David Blackman claimed that POW.
> Since then there was no further mail from him on this list and he didnīt
> answer my mail, wether he is still working on it.

OK feel free to start on it :-)

> So I would like to take over, but I have a few(?) questions left:
>
> 1) There are C++ bindings for ImageMagick, but they use exceptions, so I
> guess I canīt use them ;-)
>

We can use exceptions as of yesterday when Dom committed his work :-)

> 2) Image magick expects an error handler for some conditions, which does
> not return. Calling exit() is probably no solution inside AbiWord,
> exceptions are banned. Using setjmp.h could be a portable solution, if
> there will be no forgotten resources (I didīnt check all cases yet).
> Any comments?
>

Use exceptions :-)

> 3) Shall I try to make localization of ImageMagick error messages possible
> (I donīt know how yet, but I have the feeling that it would get far
> from perfect and ugly). Perhaps just a "could not read the image" will
> be enough.
>

How many error messages are there?

> 4) What would be a better solution?
> * One ie_impGraphic_ImageMagick which supports all image formats
> supported by ImageMagick and not by the other importers.
>
> * Having a base class ie_impGraphic_ImageMagick from which classes for
> the single formats are derived. (But this means, that when trying to
> recognize the image format of a file a lot of computing is doubled,
> because each derived importer will do the same check)
>

I think this is releated to Dom's post. I believe Dom wants generic
raster/ vector framework which can be implemented via subclasses.

All this comes down a major flame-fest we've had over the years. Should we
have more than one image format internally for raster graphics? It would
certainly make the rest of AbiWord easier if we just used imageMagic to
convert all it raster formats to png for internal use. I think we should
do this.

For vector formats I think the consesus it to use SVG for our internal
format and convert all other vector formats to this. (Like Postscript,
PDF, WMF, fig, sk...)

I believe ImageMagic has a SVG -> Postscript converter that we could use
for printing and a rasterizer for on-screen display.

Anyway, since the whole "We should do this not that" flame fest has
produced nothing but heat and no code for about 1 year, I suggest you go
with one ie_impGraphic_ImageMagick class. I think we could turn that into
a subclass more easily than a subclass be image type.

> 5) File names in ImageMagick canīt be longer than 2052 bytes. Is that a
> problem?
>

I doubt that would be a problem :-)
 
> 6) And copying Domīs remark from Davidīs mail?
> "Please don't anyone do this until after I actually code/check-in the
> new proposed imaging framework. Otherwise we'll have lots of duplicated
> code/effort."
> Was the new framework put into place?
>

Hmmm Well maybe Dom should put his framework in place then :-)

> 7) Will ImageMagick be added to the abiword sources, so we could make
> changes to circumvent some of the above problems?
> There seems to be a stripped down version of it already within the
> wv sources.
>

I guess imagemagic should be a peer library like wv. Then platforms with
good image handling already, like gnome, could overide imagemagic and use
their own stuff.

I'm looking forward to seeing some code at last.

Cheers

Martin



This archive was generated by hypermail 2b25 : Thu Jul 26 2001 - 23:39:42 CDT