php-heic-to-jpg
php-heic-to-jpg copied to clipboard
Permission denied (absent execute-permission)
Hello, noticed interesting case.
WHAT I DID
i installed your package in 2 places:
- local development (docker) -
Debian GNU/Linux 11 (bullseye) 5.4.0-137-generic - dev-server
Ubuntu 22.04.3 LTS 5.15.0-1031-aws
WHAT I GOT
i got different execute-permissions in these 2 cases.
-
local development (docker)
-
dev-server
in case 1 package works as expected. in case 2 package works with error:
Couldn't convert HEIC to JPG: 'sh: 1: /home/user/app/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64: Permission denied' |
Bin used: 'php-heic-to-jpg-linux-arm64' HEIC: '/tmp/image-editor/image-editor-2iIvs9'
Full Command: '/home/user/app/vendor/maestroerror/php-heic-to-jpg/src/../bin/php-heic-to-jpg-linux-arm64 "/tmp/image-editor/image-editor-2iIvs9" "/tmp/image-editor/image-editor-2iIvs9-19333623666504703814bc31.41181168" 2>&1'
Output from heif-converter-image exe:
when i add execute-permission for php-heic-to-jpg-linux-arm64 then package works as expected.
QUESTIONS
- why permissions are different on 2 environments?
- how should look correct execute-permissons for files?
- why in case 1 execute-permissions are absent for files
php-heic-to-jpg-{os-architecture}, but package works as expected? and in case 2 - not? - what is the suggestion to make it work in both cases (add execute-permissons for all needed files or something else)?
thanks!
Hi, @lon9man! Thanks for reaching out! I am not sure why are they different but in the first case (local development (docker)) it used heicToJpg and execute permission was correct, so it worked 👍 In the second case, it tried to use php-heic-to-jpg-linux-arm64 probably because the "dev-server" is arm64 architecture. But execution permission wasn't set, so it threw an error.
Both cases acted logically, we just need to find out, why execution permission isn't set correctly for needed bin files (Second case) and yes, to make it work all needed files should have execute-permissions 👍
@MaestroError, thanks for the response! Will you have a chance to detect the issue and update the package?
Offtop question:
Method convertFromUrl creates temporary file inside project-root.. as for me it should create it inside /tmp to prevent make a mess.
Thanks!
Strange, I think it should delete the temporary file right after execution. Sure, I will keep this issue open to remind me about it and I will update the package with the following fixes:
- Setting correct execution permission for any platform
- Delete the temp file created by
convertFromUrl
It deletes it if everything gone successfully, but if we got error - then file remains in Project-root and developer should delete artifacts manually..
if it will be located in /tmp in any case it will be good solution
Any update on this? I'm also experiencing this installing in a docker container (Ubuntu 20.04)
Hey @jdevinemt! Unfortunately not, I wasn't able to update it yet, but you can solve them easily by setting execution permission 👍