Re: Creating a new image loader

Ruben Lopez <r.lopez-u/[email protected]>
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
Aurélien Gâteau wrote:
> Ruben Lopez wrote:
>
>   
>>> You should have a look at the mimetypeutils.cpp file: in the
>>> rasterImageMimeTypes(). Does the list returned by KImageIO::mimeTypes()
>>> contains your format? If not, try to hardcode it like it's done for the
>>> xcf and pjpeg ones. You should also check that you have a proper mimetype
>>> file installed in $KDEDIR/share/mimelnk/image/.
>>>   
>>>       
>> I have created the $KDEDIR/share/mimelnk/image/x-pic.desktop and now
>> even Konqueror recognize this image as a PIC Image file. But gwenview
>> still doesn't work.
>> I have tested the KImageIO::mimeTypes in a custom program and the
>> image/x-pic mime type gets listed.
>> Any other hint?
>>     
>
> Just to be sure, check that image/x-pic is there in Gwenview (just modify
> the code to print it to stdout)
>
> You can also enable logging in the Document*Impl classes: to do so, open
> the .cpp file for which you want logs and uncomment the line "//#define
> ENABLE_LOG". I suggest you start with DocumentLoadingImpl and ImageLoader
> (this one is a bit different, you should set ENABLE_LOG to 1 or 2,
> depending on the verbosity you want).
>   

I've investigated a bit more before modifying gwenview sources. 
Konqueror preview also doesn't work for the PIC format, although it 
recognizes it as "Softimage PIC", thanks to the MIME description file.
I have added a new kfile_pic module to make konqueror know the meta-data 
of PIC files. I used the RGB plugin as a template, to be sure that every 
important meta-data item is also in my plugin.
Now I can ses properties like width / height, but the preview tab still 
doesn't work.
I imagine that gwenview uses the same component as konqueror to show 
preview of images, right? Can this be the cause?
I have created and populated my system with these elements so far:
/usr/lib/kde3/kimg_pic.so
/usr/lib/kde3/kimg_pic.la
/usr/lib/kde3/kfile_pic.so
/usr/lib/kde3/kfile_pic.la
/usr/share/mimelnk/image/x-pic.desktop
/usr/share/services/kfile_pic.desktop
/usr/share/services/pic.kimgio
/usr/share/mime/image/x-pic.xml

Is there something else that I should add to enable complete support for 
this PIC format?
Does anyone here know of a good tutorial/HOWTO for adding new image 
formats to KDE?

Thanks in advance

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gwenview-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwenview-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.