php-heic-to-jpg icon indicating copy to clipboard operation
php-heic-to-jpg copied to clipboard

error reading "ftyp" box: got box type "\x00\x10JF" instead

Open James-THEA opened this issue 1 year ago • 3 comments

I had been using php-heic-to-jpg successfully for several months, but now I am getting:

Couldn't convert HEIC to JPG: '2024/02/27 10:50:13 error reading "ftyp" box: got box type "\x00\x10JF" instead
Error while converting {filePath}.heic: error reading "ftyp" box: got box type "\x00\x10JF" instead
Created by MaestroError' | Bin used: 'heicToJpg.exe' HEIC: '{filePath}.heic'
Full Command: '{root}\vendor\maestroerror\php-heic-to-jpg\src/../bin/heicToJpg.exe "{filePath}.heic" "{filePath}.heic-161371566565de04b46309a8.17376750" 2>&1'
Output from heif-converter-image exe:  {"exception":"[object] (RuntimeException(code: 0): Couldn't convert HEIC to JPG: '2024/02/27 10:50:13 error reading \"ftyp\" box: got box type \"\\x00\\x10JF\" instead
Error while converting {filePath}.heic: error reading \"ftyp\" box: got box type \"\\x00\\x10JF\" instead
Created by MaestroError' | Bin used: 'heicToJpg.exe' HEIC: '{filePath}.heic' Full Command: {root}vendor\\maestroerror\\php-heic-to-jpg\\src/../bin/heicToJpg.exe \"{filePath}.heic\" \"{filePath}.heic-161371566565de04b46309a8.17376750\" 2>&1'
Output from heif-converter-image exe:  at {root}\\vendor\\maestroerror\\php-heic-to-jpg\\src\\HeicToJpg.php:205)

I tried updating and also downgrading to see if this was a version problem, but I couldn't get back to a working state. It definitely may be an interaction with another package my project brings in.

Happy to provide any other information!

James-THEA avatar Feb 27 '24 15:02 James-THEA

Hi @James-THEA, thanks for reaching out 👍

This type of issue is more related to file type. Some HEIC images have different box type which isn't readable by this package, especially if it isn't original HEIF, but converted one.

Also, your "Full Command" from the error looks different, it shouldn't contain strings like "{root}" and "{filePath}", did you replace them before posting here or it was like that in the error message?

You should be able to copy your "Full Command" from the error message and run it from the console. Please, do it and let me know the output 👍

MaestroError avatar Mar 06 '24 09:03 MaestroError

@MaestroError running into the same error here is the command run directly from console.

./heicToJpg 6c3df2bd-f919-4d7f-a07d-1681775b1ead.HEIC test.jpg
2024/05/23 00:45:11 error reading "ftyp" box: got box type "\x00\x10JF" instead
Error while converting 6c3df2bd-f919-4d7f-a07d-1681775b1ead.HEIC: error reading "ftyp" box: got box type "\x00\x10JF" instead
Created by MaestroError

hbjlee17 avatar May 23 '24 01:05 hbjlee17

@hbjlee17 Thanks for reaching out! ❤️ As I said this error is related to box type of HEIC images, I am sure you have this issue only on some images, right?

Here you can try different solutions, the first is working in conjunction with this package and enhancing its capabilities, the second and third are alternative ways, which are already offered by the community:

MaestroError avatar May 27 '24 09:05 MaestroError