Automatically convert thumbnails to PNG Automatically convert thumbnails to PNG
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Automatically convert thumbnails to PNG

Started by New City Vegas, August 10, 2008, 04:22:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

New City Vegas

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







New City Vegas

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

Joachim Müller

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.

New City Vegas

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.



Nibbler

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


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