It is currently Wed Nov 22, 2017 10:46 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GIF preview corruption
PostPosted: Wed Sep 21, 2016 10:22 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5830
Location: Canada
In this thread corruption of preview GIFs was discussed: https://forums.nesdev.com/viewtopic.php?p=179813#p179813

Details in that thread, but the problem seems to be that traditionally "optimized" GIFs (with each frame cropped to just the area that is different from the frame before) get severely corrupted by the resizing process.

Koitsu suggested that phpBB uses ImageMagick to do the resizing? If so, it seems that it has a "coalesce" option that needs to be applied before resizing, and probably an optimization flag as well to undo the file size explosion that coalesce will cause?

Might also be worth pointing out that the corrupted "preview" GIF in this example is actually 50% larger than the original one, which defeats part of the purpose of doing previews in the first place. I expect that more properly processing them might help with this.


Top
 Profile  
 
PostPosted: Thu Sep 22, 2016 6:39 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 583
FWIW, I use gifsicle for all my gif needs. Its abilities go far above imagemagick's.


Top
 Profile  
 
PostPosted: Thu Sep 22, 2016 4:33 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
calima wrote:
FWIW, I use gifsicle for all my gif needs. Its abilities go far above imagemagick's.

Does phpBB have native support for this? If not, then (respectfully of course), it's an irrelevant point. PHP doesn't necessarily just call a shell utility to do its conversion (I'd be very surprised, and scared, if it did), it almost certainly uses the ImageMagick module, which relies on the actual C-based ImageMagick libraries.


Top
 Profile  
 
PostPosted: Thu Sep 22, 2016 5:49 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19251
Location: NE Indiana, USA (NTSC)
MediaWiki uses the shell for thumbnails. Is that likewise scary?


Top
 Profile  
 
PostPosted: Thu Sep 22, 2016 6:18 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
tepples wrote:
MediaWiki uses the shell for thumbnails. Is that likewise scary?

Very, especially when you consider that an attack against whatever in mediawiki does thumbnail generation could effectively induce an out-of-process (e.g. fork bomb) scenario on a webserver. fork/exec are very expensive.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group