Advanced search  

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]

Pages: [1]   Go Down

Author Topic: svg support  (Read 11782 times)

0 Members and 1 Guest are viewing this topic.

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
svg support
« on: November 22, 2010, 02:55:09 pm »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #1 on: November 22, 2010, 02:58:28 pm »

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

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #2 on: November 22, 2010, 04:42:04 pm »

Please 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #3 on: November 22, 2010, 06:01:44 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #4 on: November 22, 2010, 06:04:22 pm »

Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #5 on: November 22, 2010, 06:18:42 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #6 on: November 22, 2010, 06:23:24 pm »

Was such a mod done already?
I don't know.


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.
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #7 on: November 23, 2010, 09:54:57 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #8 on: November 23, 2010, 10:19:55 am »

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.
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #9 on: November 23, 2010, 10:23:30 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #10 on: November 23, 2010, 02:05:01 pm »

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.
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #11 on: November 23, 2010, 06:09:23 pm »

Thanks.
I'll deliver feedback tomorrow.
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #12 on: November 24, 2010, 01:14:48 pm »

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 ?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #13 on: November 24, 2010, 01:31:32 pm »

All you have to do is installing the plugin. It automatically adds/updates the entry in the file types table:
Code: [Select]
    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'");
    }
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #14 on: November 24, 2010, 01:43:46 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #15 on: November 24, 2010, 01:47:48 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).
Logged

heinrich

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: svg support
« Reply #16 on: November 29, 2010, 11:12:12 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: svg support
« Reply #17 on: December 23, 2010, 01:31:13 pm »

Film strip support added in svn revision 8148. Feel free to extend the plugin.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.