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: Automatically convert thumbnails to PNG  (Read 2885 times)

0 Members and 1 Guest are viewing this topic.

New City Vegas

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • Ideaboomer / GooGeneration
Automatically convert thumbnails to PNG
« on: August 10, 2008, 04:22:48 am »

I've been playing with Coppermine only for about an hour so excuse me if I missed the obvious somewhere.

I am using Coppermine in a VERY limited way.  To provide user access to 16x16 resized icons for a new web project.

Coppermine seems to have all I need (and a whole lot more) but what I would really like is to have all uploaded images and/or thumbnails automatically converted to PNG format.

The custom PHP code change should be easy if I can find it.  Maybe you can help.

BTW, yes my host has ImageMagick already installed.

http://ideaboomer.com/gallery/thumbnails.php?album=1

Bob in Las Vegas






Logged

New City Vegas

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • Ideaboomer / GooGeneration
Re: Automatically convert thumbnails to PNG
« Reply #1 on: August 10, 2008, 04:34:53 am »

And automatic upload resizing to 16x16 pixels would be plus.  Code file location? 
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Automatically convert thumbnails to PNG
« Reply #2 on: August 10, 2008, 08:21:30 am »

Coppermine doesn't convert jpeg or gif files into png. That's something many desktop apps like IrfanView can do for you easily.
Not sure what you're asking for, but coppermine doesn't have the capabilities to merge several pics into one.
Logged

New City Vegas

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
    • Ideaboomer / GooGeneration
Re: Automatically convert thumbnails to PNG
« Reply #3 on: August 10, 2008, 09:53:41 am »

I never mentioned merging so I don't know how that came up.  That is not something I have any interest in.

Put simply: [ SOURCE .jpg or .gif or .bmp or .tif INPUT ] ----> [ DESTINATION thumbnail .png OUTPUT ]

In the CPM config "File and Thumbnail Advanced Settings", it specifically references Imagemagick's "convert" utility (presumably for resizing).  This (CPM-embedded?) convert utility could just as easily change output format (as indicated at the URL below).  It should just be finding the right PHP function code to modify.

http://www.imagemagick.org/script/convert.php

I have used the Linux 'convert' frequently to change .xwd (screen capture) files into intermediate .jpg files.  However, without proper parameters, ImageMagick's 'convert' is not very filesize-efficient.  I assume with the right parameters it can be made to employ proper compression.  With 16x16 icon files, absolute filesize is not a major concern.


Logged

Nibbler

  • Guest
Re: Automatically convert thumbnails to PNG
« Reply #4 on: August 10, 2008, 05:33:18 pm »

You can simply hardcode it here I expect in upload.php (for multi file upload mode) or db_input.php (single file upload mode)

Code: [Select]
        // Create a unique name for the uploaded file
        $nr = 0;
        $picture_name = $matches[1] . '.png';
        while (file_exists($dest_dir . $picture_name)) {
            $picture_name = $matches[1] . '~' . $nr++ . '.png';
        }

ImageMagick only of course.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.