After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 81528 - add svg loading
add svg loading
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other other
: Normal enhancement
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-05-12 08:54 UTC by jacob berkman
Modified: 2015-08-14 12:17 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch to add svg loading support (5.59 KB, patch)
2002-05-12 08:55 UTC, jacob berkman
none Details | Review
patch for viewer control mime types (1013 bytes, patch)
2002-05-12 09:04 UTC, jacob berkman
none Details | Review

Description jacob berkman 2002-05-12 08:54:39 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.
Comment 1 jacob berkman 2002-05-12 08:55:02 UTC
Created attachment 8397 [details] [review]
patch to add svg loading support
Comment 2 jacob berkman 2002-05-12 09:04:20 UTC
Created attachment 8398 [details] [review]
patch for viewer control mime types
Comment 3 Luis Villa 2002-05-13 01:56:42 UTC
Sweet.
Comment 4 jacob berkman 2002-05-13 04:05:24 UTC
Dude!  what's mine say?
Comment 5 Jens Finke 2002-05-13 07:08:34 UTC
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?
Comment 6 jacob berkman 2002-05-13 16:41:41 UTC
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 ;)
Comment 7 Jens Finke 2002-05-14 06:38:21 UTC
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.


Comment 8 jacob berkman 2002-05-14 16:27:55 UTC
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