svg support svg support
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

svg support

Started by heinrich, November 22, 2010, 02:55:09 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

heinrich

Hi,

I searched the forum, but all I could find was a earlier posting of the question I have (by someone else), that was answered with "update your coppermine".

Well, I've got the newest and wanted to ask, if there is any support for .svg-files or if such a support is planed?

Thanks,
Heinrich

Αndré

Please post a link to the thread you refer to and a link to your gallery.

heinrich

Quote from: Αndré on November 22, 2010, 02:58:28 PMPlease post a link to the thread you refer to and a link to your gallery.
What's that?
A prerecorded response?


The topic mentioned is:
http://forum.coppermine-gallery.net/index.php/topic,44045.0.html

My Coppermine is:
www.werwolf-live.de/galerie/


Both totally worthless information in regards to the question if coppermine is capable to handle "Scalable Vector Graphics" (aka .svg files) or if svg-support is planned.

Αndré

Quote from: heinrich on November 22, 2010, 04:42:04 PM
What's that?
A prerecorded response?
No. I typed every character manually ::)


What exactly means 'support' for you? You can of course upload svg files (at least as 'document', as GD doesn't support svg). I don't know if ImageMagick can handle svg files. So the answer is probably, that Coppermine already supports svg and no further support is planned. If Coppermine doesn't work as you want, a simple mod or plugin could solve your problem.

Αndré


heinrich

Was such a mod done already?


I also wanted to see, if Firefox would try to display the svg-file, if I uploaded it as document, but even though I adjusted the File-Settings to allow the extension, coppermine failed to upload, returning an error, stating the filetype was not supported.

Since many of the graphics, for example in wikipedia, are svg and support for this W3C-standard will even reach IE9, coppermine should possibly also include some kind of handling of this file type. And, if GD does not handle the files, well, it would not matter, since the browsers would render Thumbnails just great.
Thumbnails wouln't bring any file size benefit with the small .svg-files anyway.

Αndré

Quote from: heinrich on November 22, 2010, 06:18:42 PM
Was such a mod done already?
I don't know.


Quote from: heinrich on November 22, 2010, 06:18:42 PM
I also wanted to see, if Firefox would try to display the svg-file, if I uploaded it as document, but even though I adjusted the File-Settings to allow the extension, coppermine failed to upload, returning an error, stating the filetype was not supported.
You can add new filetypes easily with that plugin.

heinrich

Sure, I can use this tool to create a new file entry in the table, but only as document, not as image, although the MIME is given as image/svg+xml.

So, there will be no preview of any kind, just coppermine's icon for "Other Documents".

So, what I seem to need it a way, to let coppermine handle the picture without using GD or ImageMagick, but simply let the browser render the thumbnail and intermediate size pictures.
The file type is inherently scalable after all.

Αndré

The intermediate-sized version can be displayed with the plugin hook html_document. Can you please attach an svg file that I can use for testing? Thanks.

heinrich

Nope. This Board doesn't allow the file type, either.

Here is a lint to a svg however:
http://upload.wikimedia.org/wikipedia/commons/7/72/Variable_Resistor.svg

Αndré

Here is a first draft of the plugin that enables svg support. It currently displays the svg as thumbnail and intermedia-sized picture. I have some trouble to add the link to the thumbnail, so it's currently only possible to follow the link if you click next to the svg thumbnail.

heinrich

Thanks.
I'll deliver feedback tomorrow.

heinrich

I added the pugin, but I'm not sure, how to setup correctly.

What options did you use in the file type table?
Did you add svg as a document or picture file in the Settings ?

Αndré

All you have to do is installing the plugin. It automatically adds/updates the entry in the file types table:
    if (!mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_FILETYPES']} WHERE extension = 'svg'"), 0)) {
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_FILETYPES']} (extension, mime, content, player) VALUES ('svg', 'image/svg+xml', 'document', '')");
    } else {
        cpg_db_query("UPDATE {$CONFIG['TABLE_FILETYPES']} SET mime = 'image/svg+xml', content = 'document', player = '' WHERE extension = 'svg'");
    }
    if (strpos($CONFIG['allowed_doc_types'], 'svg') === FALSE) {
        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = CONCAT(value, '/svg') WHERE name = 'allowed_doc_types'");
    }

heinrich

Ah, okay, didn't realise that, since I had that added manually before.

There is no thumbnail-preview in the film strip.
Besides that, and the aforementioned problem with the linking, it works fine.

Αndré

Quote from: heinrich on November 24, 2010, 01:43:46 PM
There is no thumbnail-preview in the film strip.
Additionally, I guess the slide-show won't work properly (either it will be skipped, or some default icon will be used).

heinrich

Would there be any way to make the picture appear in the file approval view, as well as in the film bar.

That would be a nice final addition to this otherwise perfect working plugin.

Αndré

Film strip support added in svn revision 8148. Feel free to extend the plugin.