[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [RFC] Limiting the file formats used by KoPicture (KWord/KPresenter)
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-01-27 1:31:39
[Download RAW message or body]

On Monday 27 January 2003 00:34, Clarence Dang wrote:
> On Sun, 26 Jan 2003 01:15 am, Nicolas Goutte wrote:

Note: in the text below, I have used image like in KWord/KPresenter. So an 
image is anything QImage-based, like PNG, JPEG, TIFF, GIF... 

> > Currently in KoPicture, we assume that QImageIO can handle all image
> > formats used in KWord and KPresenter. However, it limits the portability
> > of KWord and KPresenter file formats, as a non-QT application could
> > suddenly have to deal with an image file format that it does not know.
> >
> > Therefore, I would like to limit the file formats used by KoPicture to:
>
> Please, please, do not do this!
>
> > PNG (image/png)
> > JPEG (image/jpeg)
> > JPEG2000 (image/j2k)
> > EPS (image/x-eps)
> > SVG (image/svg+xml)
> >
> > BMP (image/x-bmp)
> > WMF (image/x-wmf)
> > QPicture (image/x-vnd.trolltech.qpicture)
> >
> > In a distant future, I would like to remove WMF and QPicture, but
> > currently it is not possible.
>
> I disagree.  If WMF support is removed, then certain filters would have to
> convert to e.g. BMP and then have to convert back to WMF on export (a real
> waste of time and effort).  In the general case, forcing filters to convert
> to certain types of images and back on export would surely increase the
> lossiness of the filters (which is already too high) and decrease their
> performace.

WMF is supposed to be converted to SVG (or perhaps directly to Karbon) and 
then back if needed. Of course it means that we first need a correct SVG (or 
Karbon) support before doing this (so it is more for KOffice 2.0, whenever 
that would be.)

As for lossiness, I do not think so. PNG can do everything another image 
format can do, including transparency. The only problems are JPEG and 
JPEG2000, as using PNG instead result in much larger files.

>
> > In a less distant future and perhaps already
> > for KOffice 1.3, I would like to remove BMP too.
>
> But why?  Both WMF and BMP are well supported.  In both Windows and Linux.
> Certainly BMP support should not be removed since BMP is a fairly universal
> format.

We are replacing MS Office, do not we want to replace MS file formats too?

I do not mind keeping BMP, but as converting it to PNG does not lose anything, 
it thought it would be better to convert it. (Reason: smaller temporary files 
in KoPictureImage.)

For WMF, well, we have already found files (with the special header) that do 
not follow the specifications. So how many variants exist too? Can the 
foreign application read all these variants too?

That is exactly what I would want to avoid: it is to have a KWord file that a 
foreign application cannot read because of the used picture file.

>
> > The advantage is, as already written, a better compactibility with non-QT
> > applications and theirs import filters. (You can see it similar to why we
> > limit KOffice's XML documents to be in UTF-8.)
>
> If non-QT office suite applications can't read BMP, they probably won't be
> very popular anyway.  Admittedly, though, less so for WMF but each image
> format has its own characteristics and I think it would make filters too
> lossy (for people who work largely with foreign formats).

I am not really talking about MS file formats. I am also talking about GIF, 
TIFF, TGA and what QImageIO may support (with KImageIO's help.). That is a 
whole jungle of file formats and not always common ones.

For example AbiWord including its plug-ins only know PNG, JPEG, BMP, WMF and 
SVG. Therefore AbiWord's KWord import filter would only be able to handle 
those pictures in a KWord document.

>
> > An incovenient is that many image formats must be converted to PNG when
> > an image is inserted by the user or when loading a document (possibly by
> > a filter.)
>
> Provide KoPicture methods that convert between the images.

I have done it this weekend: the result are the two methods named 
KWEFBaseWorker::loadAndConvertToImage (used in KWord's AbiWord and RTF export 
filters.)

(There is also the new method KoPIcture::generateImage)

> I actually have to convert PNG to WMF...

Why not to BMP? Or does MSWrite only knows WMF?

>
> > A second incovenient is that export filters might have to convert again
> > the picture. However as no file format knows all of QT's image formats,
> > all export filters will need to have code to convert images. So these
> > export filters are not bloated.
>
> There are too many different document formats that support different types
> of images.  If you are going to make it convenient for some export filters,
> then you are going to make it very hard for others e.g. for mswrite, the
> only format that is truely supported is Standard WMF/BMP.  I think the only
> solution is that have KoPicture handle everything and be able to convert
> between everything.  Maybe when an image is inserted into KWord, the user
> should be given the _option_ to convert it to something like PNG or JPEG (I
> guess a global option for filters would be good too) but I don't think we
> should restrict what images the KWord format supports at all.

The problem is that a normal user will never use that option. (You could 
compare it to how many people are using RTF instead of the MSWord native 
format to ease excahnge between word processors.)

And as written, you need the additional code in any way for a full support. 
For example, as MSWrite only support BMP as image format, then you would need 
to convert a GIF to BMP. Similar for the WMF output, if you have a SVG, you 
would prefer to convert it (unlike what is possible currently.)

And my idea is not to favor some filters against others. Your filter needs BMP 
instead of PNG, no problem. A PNG-aware filter converts all unknown image  
formats (including BMP) to PNG, your filter would do the same but to BMP (and 
considering PNG as an unknown format.)

Similar with non-image pictures, the filter either know SVG or WMF, not both. 
So you will have to convert in anycase. (And as written, we have not yet 
enough support for that.)

>
> Thanks,
> Clarence

Have a nice day/evening/night!

>
>
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/koffice-devel

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic