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

Add option for file path prefix + add followlocation option to curl calls #67

Closed
wants to merge 3 commits into from

Conversation

joeke
Copy link

@joeke joeke commented Apr 7, 2021

This PR fixes an issue, and adds a new feature.

Fix:
Add CURLOPT_FOLLOWLOCATION to remote image curl calls to allow curl to follow redirects (e.g. 301) on the remote url.
(fixes issue #56)

Feature:
Add filePathPrefix option to enable a prefix for the output image path. This option can be used in the snippet call options parameter, for example:
[[pThumb?&input=`https://test.com/my-image.jpg`&options=`&w=300&h=300&filePathPrefix=[[*id]]`]]

Which will result in adding the resource id in the output file path (using resource ID 1 as an example):
assets/image-cache/1/my-image.jpg

This is a welcome addition when handling large amounts of images where the source images are all in the same folder, which results in the image-cache folder having a lot of items, and it also makes pthumb slower with checking existing files and generating thumbnails since it has to navigate through this large folder.

@matdave matdave requested a review from theboxer April 7, 2021 21:40
@joeke
Copy link
Author

joeke commented Apr 14, 2021

@matdave @theboxer Have you had the time to look into this?

@joeke joeke closed this by deleting the head repository Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant