Outline ·
[ Standard ] ·
Linear+
PNG image attachment automatically gets JPEG-ed, This forum software is dumb
|
TSxenon
|
Mar 22 2007, 07:47 PM, updated 19y ago
|
|
I'm just expressing my discontent on this forum software. Whenever I want to attach a screenshot, I face this problem. Take this example http://forum.lowyat.net/index.php?act=Atta...=post&id=207929My original PNG file is 11.3kB, after attaching, the forum does some unnecessary work, recoding the image to JPEG sizing 55.9kB. The result is poorer image quality (mosquito artifacts) and multiple folds increase in file size. I can get by this problem by using GIF format, but for more than 90% of the time, PNG achieves smaller size. In this example, the GIF is 27.6kB (still better than the forum software auto-JPEG). Another way is by using external image hosting. But I prefer to store those 20kB pictures on forum.lowyat.net as it is most likely loads fastest for the users. So, my conclusion is this forum software is torturing itself, wasting computing resource, wasting disk space, wasting bandwidth. Solutions?
|
|
|
|
|
|
se7en
|
Mar 22 2007, 07:57 PM
|
resistance is futile
|
what conversion? will test more later, but i reckon the forum might convert the thumbnail to jpg if its too big, but the image you upload should still be in png format. Attached image(s)
|
|
|
|
|
|
TSxenon
|
Mar 22 2007, 07:59 PM
|
|
Oh, yeah. I think I experienced that before, smaller dimension (number of pixels) behave differently. Try bigger ones? 400x300 maybe?
Nope, the thumbnail JPEG is acceptable, but the problem is full size also JPEG.
This post has been edited by xenon: Mar 22 2007, 08:00 PM
|
|
|
|
|
|
se7en
|
Mar 22 2007, 08:02 PM
|
resistance is futile
|
test 2 Attached thumbnail(s)
|
|
|
|
|
|
wKkaY
|
Mar 24 2007, 06:35 AM
|
misutā supākoru
|
It's probably due to the code that adds that lowyat.net watermark to the image.
Do we want to add smarts to the routine? Hmm..
|
|
|
|
|
|
TSxenon
|
Mar 24 2007, 07:54 AM
|
|
I think the watermark adding doesn't happen to GIF attachment. By the way, I don't like watermark. Vote for remove watermark code.
|
|
|
|
|
|
se7en
|
Mar 24 2007, 10:20 AM
|
resistance is futile
|
don't think its the watermark. It worked quite fine for the png that wasn't resized. I reckon it has something to do with the GD library that resizes PNG images.
|
|
|
|
|
|
wKkaY
|
Mar 24 2007, 10:23 PM
|
misutā supākoru
|
Nuh uh..  I checked the file type of that unresized thumbnail.. QUOTE $ file post-2-1174564631.png post-2-1174564631.png: JPEG image data, JFIF standard 1.01, comment: "CREATOR: gd-jpeg v1.0 (using IJ"
|
|
|
|
|
|
TSxenon
|
Aug 11 2007, 08:12 AM
|
|
Problem not solved yet. Another problem is zip file gets gzip-ed automatically. I would like the attachments to be treated as raw bytes, verbatim. The forum software shouldn't go busybody interpreting the bytes that I send. It should also treat the whole file name as one string, don't interpret the extension. I found that the zip file problem occurs when the file name ends with .zip, it will not occur when it is named otherwise. There are quite a lot of file extensions not allowed as attachment, for example .7z. My suggestion on extensions is just to disallow file names ending with .exe while uploading, otherwise allow the attachment, don't interpret what is the extension, don't look into the bytes of attachment. Maintain byte-for-byte of the upload. The extension can however be used to set the Content-Type of HTTP header when a forumer wants to download the attachment. But the Content-Type setting should be minimal, only for .png, .jpg, .gif, .txt, for example. Other files should be just octet stream. This post has been edited by xenon: Aug 11 2007, 08:31 AM Attached image(s) Attached File(s)
430787_zip_test.zip ( 10.67k )
Number of downloads: 37
|
|
|
|
|
|
wKkaY
|
Aug 11 2007, 05:27 PM
|
misutā supākoru
|
1) The easy fix for the thumbnail is to not watermark the images. That is se7en's decision. Extra code can be added to repack the watermarked image as a PNG, but JPEG is acceptably fine, really.
2) Gzip encoding problems will be fixed once we get the new server. Right now there's too many layers contributing to the problem.
3) I don't see any incentive to change the filename restrictions, especially one that proposes a change from the current "default deny" policy to a "default allow" one, so they'll remain unchanged.
|
|
|
|
|
|
sHawTY
|
Aug 11 2007, 06:41 PM
|
|
QUOTE(xenon @ Mar 24 2007, 07:54 AM) Who are you to say that? The owner of this forum?
|
|
|
|
|
|
wKkaY
|
Sep 15 2007, 08:39 PM
|
misutā supākoru
|
OK, the zipfile corruption problem should be resolved now.
|
|
|
|
|
|
TSxenon
|
Sep 15 2007, 11:32 PM
|
|
|
|
|
|
|