Transform function - help, please
I'm not versed at all in regex and need help transforming a thumbnail URL to a full size image URL.
For the site in question:
Thumbnail URL is:
https://cdn.example.com/460/7/206/86412400/86412400_001_b01e.jpg
Full size image URL for the above would typically be:
https://cdn.example.com/1280/7/206/86412400/86412400_001_b01e.jpg
(but the "1280" could be a different # like 800 or whatever)
NOTE: the subdomain "cdn" could be different sometimes in both URLs.
So what would the Transform rule be in Image Picka?
Currently there is no way to map one URL to multiple URLs. So unfortunately the target URL can only be one of "1280" or "800".
Is there a link pointing to the original image? Maybe "detect image from links" option can help.
Otherwise, we will have to find a way to make transform rule support multiple targets.
Is there a link pointing to the original image? Maybe "detect image from links" option can help.
I tried that option but what it does is it also grabs the thumbnail image as well as the link image and that impedes my workflkow.
Currently there is no way to map one URL to multiple URLs. So unfortunately the target URL can only be one of "1280" or "800".
Yeah I realized after I posted that there's no way to use like a wildcard. I went with the "1280" since that is used like 99% of the time. In my case, the following transform rule works...
^(https?://[^/]+)/460(/.+)$
$1/1280$2
I tried using multiple rules for one site but that doesn't work as the add-on will only use the first rule per site.
^(https?://[^/]+)/460(/.+)$
This regex will match all domains. Here is a more specific one:
^(https?://[^/]+\.example\.com)/\d+(/.+)$
$1/1280$2
\d+ represents any numbers.