Bloat on normal images produced form gifs - Bandwidth hell! Bloat on normal images produced form gifs - Bandwidth hell!
 

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

Bloat on normal images produced form gifs - Bandwidth hell!

Started by loafer, November 16, 2003, 05:05:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

loafer

Hi there!

I think I have found a problem with uploading gif images that get a normal view created.
I've uploaded a pretty normal gif that is 44.97 KB (46054 bytes)
The normal image that has been created is 223.02 KB (228371 bytes)!

That's almost 5 times bigger!

Any idea what's going on? or better still an idea of what I can do to fix it? :?

Loaf.

Oasis

Yes, I have noticed this problem too.
But I assume it is a limitation of imagemagick...
One of my users uploaded a 59K animated gif,
and the thumbnail turned out 750K.

Do any of the dev team members know imagemagick well enough to find a way to fix this?
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

hyperion

This is expected behavior for Image Magick.  Due to the Unisys patent, no one may use LZW-compression without paying Unisys. This patent expired in the US in June of this year, and it will expire in the rest of the world in June/July 2004. GD dealt with this problem by removing GIF creation capability from GD.  Image Magick dealt with the problem by removing GIF compression. So Image Magick can create a GIF, but it cannot compress it. This is why your GIFs become so large.

Both teams have said they will return this function when all patent issues are resolved.

It is posible to work around this problem if you wish to manually reisze the GIFs and place them in the file system.  However, this may not be feasible for people with thousands of GIFs.  Some developers are working on animated PNGs; they may have progessed since I last read about their project.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Oasis

Good good good... I will be looking forward to the new versions...
I don't like having a 800K gif on the front page.  :lol:
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Oasis

I have a suggestion... Since we probably will have to wait at least half a year before the new versions come out, could we have a workaround for the time being?

As we know, resizing the gifs into thumbnails are going to create even larger files... Then why don't we just skip the IM resizing and show the original gif as the thumbnail? There's not much point in creating a smaller thumbnail if it's going to be a bigger size... Why not just show the original and specify the display size??
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

loafer

Hell, I'd settle for a hacked version of imagemagick I could slap in the directory with a shellscript and a cronjob!

hyperion

Loafer,

*looks around for flying army of monkey lawyers*

Since you seem to know something about *nix, I'll tell you a secret. It is supposed to be possible to manually compile Image Magick with LZW compression turned on . . . you might check Google. If you're in the US, it's perfectly legal.

*scuttles away before Unisys can issue a subpoena*

-Hyperion
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

hyperion

Oasis,

Skipping GIF resizing for thumbnails in IM would require slight modifications to include/picmgmt.inc.php.  

Then you would need to modify include/functions.inc.php display_thumbnails to give GIFs width and height parameters in the HTML img tag.

Alternatively, you could modify the display thumbnail function to skip the display GIFs larger than a certain size when the album is a meta album like random and last added.

-Hyperion
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

loafer


loafer

Just a sec - couldn't coppermine use PNG in this case?

Joachim Müller

Coppermine always can use png, and you're encouraged to use png whenever possible (some people around may even remember the "burn all gifs" campaign some time ago).

[off topic]Yeah, I think gifs s**k as material to appear in a gallery, but I didn't want to come up with a flame war on this issue. I believe in forcing M$ and the other browser creators to fully support png by getting rid of gif support, but that's just my personal opinion.[/off topic]

GauGau

loafer

You missed my point, so I'll ask you a different way.

How do I get coppermine to only use png for processed images of gifs?

hyperion

Coppermine can use image magick to convert regular GIFs to PNG, and it can convert animated GIFS to MNG.  However, there is no browser that I know of that can display MNGs.

To do this, you would modify include/picmgmt.inc.php.  You would need to chop the extension off of a cast of the GIF filename, and then append the .png extension. You would then use the modified cast of the filename in place of the orginal filename in the file formulation varialbles $normal and $thumb near the beginning of the file.  Image Magick does the rest for you.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Satrina

Has anyone tried the above mentioned thing? I am a total newbie when it comes to php, but I would really like to eith have it skip resizing gifs or do something else entirely. As they just come out looking bad and larger then the original. Step by step how to would be so appriciated! :) I know I know why use gifs! I have one of those evil forums filled with peoples animated sigs and all they know is gifs ;)

Would really appriciate help here! thank you so much! I read a bunch of another posts but didn't see an exact answer or if the above method worked well.

thank you!

-Marie

hyperion

I don't think anyone ever tried it to comment on whether or not it would work well. 

Just to let you know, GD and IM will reintroduce GIF support in a month or so.  If you can compile ImageMagick, they have finally put clear instructions on how to compile IM with LZW compression on their website. I also think the animated GIF corruption problem was fixed in one of the more recent releases of IM. This topic was posted around 5.7, and they are now at 6.X.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Satrina

Thanx for the info, I can wait then! :) I am using the latest IM though.

-Marie