Skip to main content
Topic: [ADDON] Image caching (Read 5831 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[ADDON] Image caching

Image caching v0.1.0
When 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?


License
o 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 / Download



Change log

  • 0.1.0 - Initial commit
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Image caching

Reply #1

This mod should get preview from image that is using http:// url?


Re: [ADDON] Image caching

Reply #3

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.

Re: [ADDON] Image caching

Reply #4

Yep, that's what it is supposed to do.
Bugs creator.
Features destroyer.
Template killer.


 

Re: [ADDON] Image caching

Reply #6

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
Code: [Select]
if (!($parseboard['scheme'] === 'http' || $parseboard['scheme'] === $parseimg['scheme']))
with
Code: [Select]
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 :)
Last Edit: May 02, 2015, 03:22:33 pm by phantom

Re: [ADDON] Image caching

Reply #7

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).
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Image caching

Reply #8

good to know :) Thanks

Re: [ADDON] Image caching

Reply #9

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?
192.MY.ID: Forum ISP Indonesia.

Re: [ADDON] Image caching

Reply #10

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.
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Image caching

Reply #11

Quote from: emanuele – 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
192.MY.ID: Forum ISP Indonesia.

Re: [ADDON] Image caching

Reply #12

What you were looking for?
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Image caching

Reply #13

French translation in attachment