SLIR for rendering images on a different web server..

196 views
Skip to first unread message

BeeTokens

unread,
Dec 16, 2011, 2:36:55 PM12/16/11
to Smart Lencioni Image Resizer
is it possible to configure SLIR to get images from a different web
server, size them, cache the results locally and then return with the
resized image?

I assume this will have to be with the ?i querystring, but when I
played with it a bit, it would not accept a fully qualified url (ex.
http://upload.wikimedia.org/wikipedia/commons/thumb/2/26/YellowLabradorLooking_new.jpg/260px-YellowLabradorLooking_new.jpg)

Would it be easier to modify SLIR to meet these needs, or should I
build a wrapper that cURLs that grabs the image, stores it, and then
use SLIR?

Joe Lencioni

unread,
Dec 16, 2011, 3:28:38 PM12/16/11
to smart-lencioni...@googlegroups.com
SLIR removes the protocol and the domain from the request for security reasons. Between modifying SLIR and extending it in some way, extending it would be more sustainable for you. If you end up doing this, please share your code.

ad...@bee-tokens.com

unread,
Dec 16, 2011, 3:30:38 PM12/16/11
to smart-lencioni...@googlegroups.com
Will do,

Thank you.
--

Thank You for Using Bee-Tokens

-Bee-Tokens Admin

ad...@bee-tokens.com

unread,
Dec 16, 2011, 3:31:24 PM12/16/11
to smart-lencioni...@googlegroups.com
oh,, do you have any API hooks that I could leverage? or just shoehorn it in?

Joe Lencioni

unread,
Dec 16, 2011, 3:34:26 PM12/16/11
to smart-lencioni...@googlegroups.com
I haven't set up any API hooks. Your best bet would be to extend some classes. If you can see any ways that SLIR could be tweaked to make this easier, let me know.

BCN

unread,
Dec 30, 2011, 4:27:51 AM12/30/11
to Smart Lencioni Image Resizer
I did not extend like Joe recommended but the changes that needed to
be made were simple enough.
In slirimage.class.php
line 248
change: return SLIRConfig::$documentRoot . $this->path;
to: return $this->path;

Also in slirrequest.class.php I made some simple changes to a few
functions much like above.
functions:
pathExists
fullPath
isPathSecure
stripProtocolAndDomain

I did not list my changes because you will have to decide how much
error checking you want to include.





On Dec 16, 2:36 pm, BeeTokens <beetok...@gmail.com> wrote:
> is it possible to configure SLIR to get images from a different web
> server, size them, cache the results locally and then return with the
> resized image?
>
> I assume this will have to be with the ?i querystring, but when I
> played with it a bit, it would not accept a fully qualified url (ex.http://upload.wikimedia.org/wikipedia/commons/thumb/2/26/YellowLabrad...)
Reply all
Reply to author
Forward
0 new messages