Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regexp search and replace of image source #158

Open
mosbth opened this issue Nov 10, 2016 · 0 comments
Open

Allow regexp search and replace of image source #158

mosbth opened this issue Nov 10, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@mosbth
Copy link
Owner

mosbth commented Nov 10, 2016

I got this as an email.

My question now lies around trying to call in images from a remote folder, such as an AWS S3 bucket, without using the full URL in the call

EG: imageserver.com?src=https://myremotefolder/image.jpg

Is there anyway to rewrite or hardcode the remote folder into the settings so that I could just call the image normally,

EG: imageserver.com?src=image.jpg

My thought behind this is if the server that is running this library becomes unusable for some reason, I could easily launch a new one with the same base code and then continue to server the images as they are on the server directly but in a remote folder/bucket.

My response was

I've been thinking about what you suggests. One way is to use rewrite rules in htaccess, but that would be a bit tricky, another way would be to allow for the user to apply a set of regexp on the &src and allowing for the regexp to be configurable in img_config.php.

imageserver.com?src=remote/image.jpg
or
image/remote/image.jpg (using standard cimage htaccess rewrite rules)

regexp find/replace on $src

#remote#
#https://myremotefolder/#

could become

$src = https://myremotefolder/image.jpg

@mosbth mosbth self-assigned this Nov 10, 2016
@mosbth mosbth added this to the v0.8.backlog milestone Nov 10, 2016
@mosbth mosbth added the feature label Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant