Image caching v0.1.0When using HTTPS connections the browers usually do not show external images embedded with the img tag that link to HTTP urls because they breach the security of the page.
This addon, when necessary, fetches a preview of the image, stores it in the cache directory and shows it in place of the original image, along with a message (added through javascript) that instruct the members and visitors to click to see the image at it's original size.
It's a very basic implementation without any setting, more will come.
Future development:
- Add settings for example to define different maximum size of the cached images
- do not use SSI in order to reduce the load when presenting the cached image (maybe allowing to define an additiona directory, the same as avatars)
- Whitelisting or blocklisting of domains (related to copyright & C)
- Suggestions?
Licenseo This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause
Repository / DownloadChange log
This mod should get preview from image that is using http:// url?
looks like it
@emanuele @Spuds Is it for HTTP to HTTPS conversion scenario ?
AFAIK, if you are using an httpS connection to a site, and say you embed an image in a post to a 3rd party site like http:\\some.image.here its not going to show up. That is due to the httpS connection, its is not going to fetch that image since its not part of the secure connection.
The work around is to have the server fetch the image from the 3rd party, cache it, and them send it over the S connection.
Yep, that's what it is supposed to do.
I think that it's not working correctly.
When i post http:// image there is no difference with or without this addon. If you need I can give you account to test it on my site.
//edit 1
I replaced
if (!($parseboard['scheme'] === 'http' || $parseboard['scheme'] === $parseimg['scheme']))
with
if (!($parseboard['scheme'] === 'https' || $parseboard['scheme'] === $parseimg['scheme']))
and it seems to work now, but is this 'fix' really fixing it?
//edit 2
and package-info.xml is missing instructions for language file :)
Indeed the fix is a proper fix.
And... well, did I already say anyone I do not test most of the code I write? Thanks for the report! :D
I'll fix both ASAP (i.e. not now, but hopefully in the next week or so).
good to know :) Thanks
Hi, I just activated this addon and if I understand it correctly this will show the images as thumbnail in the post? when it's clicked it will opens original source url not the cache?
Yes.
To me there are few implications nowadays about copyright and storing images "belonging" to external websites, even is only in the form of a "cached" image. So the safest solution was to fetch only a thumbnail (i.e. fine in most of the cases by the fair use principle) and open up the original one for the original.
thanks for the explanation, then i misunderstood about the function. haha. :D
What you were looking for?
French translation in attachment