image-picka icon indicating copy to clipboard operation
image-picka copied to clipboard

Transform function - help, please

Open vrepub opened this issue 4 weeks ago • 3 comments

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?

vrepub avatar Dec 09 '25 20:12 vrepub

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.

eight04 avatar Dec 10 '25 12:12 eight04

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.

vrepub avatar Dec 10 '25 18:12 vrepub

^(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.

eight04 avatar Dec 11 '25 02:12 eight04