Hot linked (embedded) images now converted into attachments

Amin

Hall of Famer
From now on, our forum software will automatically convert hot linked (embedded) images into attachments.

Meaning that images hosted at domain.com and hot linked in a forum post like this:

Code:
[IMG]https://www.domain.com/image.jpg[/IMG]

will automatically be turned into attachments hosted on our server and inserted into a forum post like this:

Code:
[ATTACH=full]123456[/ATTACH]

EXIF information and any associated links are preserved.

Why do this? A few reasons:

1) It prevents images from becoming broken. Say a host like PBase decides to stop allowing direct linking. Everyone using that host has all their forum images stop showing.

With all the financial news about Yahoo these days, including their upcoming potential acquisition by Verizon, I'm concerned about what could happen to Flickr. If all of our Flickr embeds were to become broken, it would gut our forums. I am trying to stay ahead of that possibility.

As it is, many of our members accidentally break their forum images by editing or re-organizing images on their host. Our image showcase threads are full of older, broken images.

2) It lets us provide faster page loading. Some members post very large file size images, well over 1MB per image. A thread full of images like that will simply drag on the typical mobile internet connection and even many desktop connections. By changing them to attachments, we can resize them to a max 1600px image dimension and do some light compression. The difference in image quality is negligible, while the page loading difference can be noticeable.

3) It lets us serve images securely (https) even when they are hotlinked from non-secure (http) sources.

At any time, members with an active account (not banned or deleted) can continue to have full control over deleting any of their images by editing a post and deleting the associated attachments.

I realize that some members may see this change as making it harder to control their images. For example, you may be someone that embeds their Flickr image on many different sites at the same time. Deleting that image from Flickr may be your way of taking it down from multiple sites all at once.

In order to make it easier to delete or re-use attachments here, we've added a new attachment manager. You can access it from your control panel as shown below:

attachmgr.png


I hope everyone likes the change. Let me know!
 
Last edited by a moderator:
After receiving feedback from members on all the sites, I got the software developer to modify the code so that all links (including links from the images) are preserved during the conversions. It breaks the lightbox functionality, but keeping the links was a priority.

Also, EXIF data is preserved during the conversion unless the image has to be resized (dimension longer than 1600px).
 
Last edited by a moderator:
Amin may I ask if we resize to a max of 1600px ourselves, will that avoid third party conversion software attempting to down-sample on our behalf or does this happen irrespective?
Thanks,
 
Hi Tom, the software will try to compress the file regardless, but it won't resize anything which is already 1600px or less.

Anything posted at 1600px or less gets processed with jpegoptim quality 90.

Anything over 1600px is resized to 1600px using Imagick resizeImage, filter Lanczos, blur factor 1, followed by Imagick unsharpMaskImage (0 , 0.5 , 1 , 0.05), followed by jpegoptim quality 90.

I experimented with a lot of different settings, filters, etc, before settling upon those as a good compromise between image quality and file size.
 
Thanks for the response Amin - I think it's a reasonable approach. I was merely interested in the technicalities and whether a direct 1600x upload with a bicubic sharper reduction to 1600x would result in a 'better' jpeg. It would be interesting to see for example the differences between a downsampled image from imagemagick to 1600px and an image downsampled with bicubic sharper reduction in photoshop.
 
I'll give you some links to an example shortly. Imagemagick does a good job!

Btw - I'm not compressing to save server space. Server space is relatively cheap. I'm compressing to keep the page loads as speedy as possible while keeping quality up and not resorting to small image dimensions.
 
Okay, here's a sample.

First, the original size JPEG (18.9MB): Orig-18.9MB.jpg

This is what our forum produces (Imagick resize + USM + jpegoptim) if you upload that full-res image (662KB): Orig-Fm-662KB.jpg

The same image resized from original to 1600px using Photoshop "automatic" and saved at max quality (2.1MB): PS-Automatic-2.1MB.jpg

What our forum produces (jpegoptim) if you upload that 1600px 2.1MB image which was resized in Photoshop (685KB): PS-Fm-685KB.jpg

Lastly, this is the 1600px version Flickr produces automatically from the original size upload (1.17MB): Flickr-1.17MB.jpg
 
First of all - beautiful image Amin! (show off :D :p ;))

For my tastes the two Photoshop exported images look best and retain the most perceptive detail.

The Imagick is not far off the PS results to be honest - impressive.

The flickr results are mushy - this is flickrs issue obviously.

Clearly the jpegopim conversion makes a huge difference to storage and negligible to file quality if at all perceptive , certainly a web resolution you will not notice.
 
Back
Top