GNOME Bugzilla – Bug 81528
add svg loading
Last modified: 2015-08-14 12:17:11 UTC
this patch lets eog load svg images. it's lame because it just tried to load it as a pixbuf or svg, and also because it does not do good svg zooming. but, it is better than what we have.
Created attachment 8397 [details] [review] patch to add svg loading support
Created attachment 8398 [details] [review] patch for viewer control mime types
Sweet.
Dude! what's mine say?
I love the idea to support svg files, it's very cool. Although I have two comments on this patch: 1. Please write a ChangeLog entry. 2. Personally I would prefer a solution where you first call a function which tries to load a pixbuf from the stream/file and if this fails it calls a function which tries to load a svg. Your patch merge this functionality all together into one function, which I think isn't very clear and is hard to extend (eg. if we want to support other file formats in the future). Can you rework your patch this way?
to do #2, you'd have to keep buffering the bytes you read, right? the point of the write_pixbuf and write_handle variables is the pixbuf and svg loaders will return FALSE when the file is not something they can read. so if you start loading a svg file, the pixbuf loader's write function will only get called once. the real answer is to get gdk-pixbuf to support more things, or to have an extensible backend structure. honestly, i don't have much time / interest in fully implementing #2, nor do i really see much benefit. i just wanted eog to be able to load svgs so i could test librsvg, and figured i'd send the patch upstream. i'd be happy to write a ChangeLog entry and commit it, though ;)
Yes, you are right. Haven't thought of the byte consuming of the loaders. Indeed this makes things more complicated and I can live with the way it's implemented now. Feel free to commit your patch with a ChangeLog.
thanks, committed: 2002-05-14 jacob berkman <jacob@ximian.com> * libeog/GNOME_EOG.server.in: we can load image/svg now * viewer/eog-image.c (load_image_from_stream): (load_image_from_file): support loading svg images (and fix some memleaks) * configure.in: require librsvg fixes bug #81528