images icon indicating copy to clipboard operation
images copied to clipboard

document how to pass in urls with ? / & marks

Open abubelinha opened this issue 2 years ago • 4 comments

Original image url (from IIIF server): https://merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

I guess this fails because there is a "?" in the original url? https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

// 20220310130335
// https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?FIF=PIA03883.pyr.tif&WID=800&CVT=jpeg

{
  "status": "error",
  "code": 404,
  "message": "Invalid or unsupported image format. Is it a valid image?"
}

abubelinha avatar Mar 10 '22 12:03 abubelinha

Users are expected to URL-encode the given URL, or at least ? to %3F and & to %26, for example: https://images.weserv.nl/?url=merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi%3FFIF=PIA03883.pyr.tif%26WID=800%26CVT=jpeg

kleisauke avatar Mar 10 '22 12:03 kleisauke

Great!! I was suspecting something like this, but I asked because I couldn't find it in the FAQ/docs. Now I see other similar issues (#220, #175, ...)

I suggest adding it to FAQs or as a note next to the main example in docs.

abubelinha avatar Mar 10 '22 12:03 abubelinha

Indeed, we should probably note this in the docs.

kleisauke avatar Mar 10 '22 13:03 kleisauke

I edited the title and reopen the issue as a reminder of adding this to docs. Feel free to close it if you prefer.

abubelinha avatar Mar 11 '22 13:03 abubelinha

Documentation has been updated to note this. https://wsrv.nl/docs/introduction.html#how-it-works

kleisauke avatar Mar 23 '24 13:03 kleisauke