mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2026-04-25 15:05:56 +03:00
[GH-ISSUE #108] Unsupported filetype for valid image using geturl.php #83
Labels
No labels
Feature request
Feature request
bug
cant reproduce
enhancement
help wanted
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pictshare#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dessalines on GitHub (Feb 27, 2020).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/108
Could you help me test this seemingly valid image with geturl.php?
https://MY_PICTSHARE.com/pictshare/api/geturl.php?url=https://i.guim.co.uk/img/media/4d908693e566fdd7f8cdeac559f6375b739887a3/356_37_3264_1958/master/3264.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=3a70177dcc60673c606302d96fcbd9bc
Error:
@geek-at commented on GitHub (Feb 27, 2020):
are you using the docker container or did you install it yourself?
If it's the latter it looks like you're missing some libraries.. does the server have the
filecommand?@dessalines commented on GitHub (Feb 28, 2020):
Its using shtripok's docker (necessary for arm compatibility too I think). My
docker-compose.ymlsection:Did you test this one out?
edit: I also forgot to mention, that most urls work, its just some don't.
@geek-at commented on GitHub (Feb 28, 2020):
Actually the latest official docker images detect the architecture and should work on ARM without a problem
But it seems that the site you're using is checking some sessions or something because when I open your image in the browser it works
But when I download it with curl
curl "https://i.guim.co.uk/img/media/4d908693e566fdd7f8cdeac559f6375b739887a3/356_37_3264_1958/master/3264.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=3a70177dcc60673c606302d96fcbd9bc"
It's answering with
So it's not a problem with Pictshare, it's the caching server that required some headers probably
@dessalines commented on GitHub (Feb 28, 2020):
Hrm this is strange... when I run that exact same curl command on my local machine, it does download the picture fine. What curl you on?
@geek-at commented on GitHub (Feb 28, 2020):
Sorry I copied the link after I put it in my browser.
when you curl with the original link you posted
curl "https://i.guim.co.uk/img/media/4d908693e566fdd7f8cdeac559f6375b739887a3/356_37_3264_1958/master/3264.jpg\?width\=1200\&height\=630\&quality\=85\&auto\=format\&fit\=crop\&overlay-align\=bottom%2Cleft\&overlay-width\=100p\&overlay-base64\=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc\&enable\=upscale\&s\=3a70177dcc60673c606302d96fcbd9bc"You'll get the error. It seems one of the variables attached to the image is a session ID that's not available for long
@dessalines commented on GitHub (Feb 28, 2020):
That one is different than the link I posted at the top, it seems to have a lot of extra slashes.
This command is correctly downloading the image:
curl "https://i.guim.co.uk/img/media/4d908693e566fdd7f8cdeac559f6375b739887a3/356_37_3264_1958/master/3264.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=3a70177dcc60673c606302d96fcbd9bc" -o test_img@geek-at commented on GitHub (Mar 6, 2020):
Did you rawurlencode the URL before attaching it to
https://MY_PICTSHARE.com/pictshare/api/geturl.php?url=? because that url has "&" and "?" in it so if you usePictshare would only see
url=https://i.guim.co.uk/img/media/4d908693e566fdd7f8cdeac559f6375b739887a3/356_37_3264_1958/master/3264.jpgwhich will return an invalid image.if you rawurlencode it to
https%3A%2F%2Fi.guim.co.uk%2Fimg%2Fmedia%2F4d908693e566fdd7f8cdeac559f6375b739887a3%2F356_37_3264_1958%2Fmaster%2F3264.jpg%3Fwidth%3D1200%26height%3D630%26quality%3D85%26auto%3Dformat%26fit%3Dcrop%26overlay-align%3Dbottom%252Cleft%26overlay-width%3D100p%26overlay-base64%3DL2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc%26enable%3Dupscale%26s%3D3a70177dcc60673c606302d96fcbd9bcand attach it encoded to the api, it works on my end
returns
@dessalines commented on GitHub (Mar 7, 2020):
That did it, thanks!