failed to resample image
failed to resample image
When updating the database, i get the message:
What can I do to overcome this error?- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
Here is the code that created the error message:
I think that one of the two reason created the error:
If this doesn't help send me the cover.jpg file by private message for examination.
Success CasN!
Code: Select all
$extension = strtolower(substr(strrchr($image, '.'), 1));
if ($extension == 'jpg') $src_image = @imageCreateFromJpeg($image) or message(__FILE__, __LINE__, 'error', '[b]Failed to resample image:[/b][br]' . $image);
elseif ($extension == 'png') $src_image = @imageCreateFromPng($image) or message(__FILE__, __LINE__, 'error', '[b]Failed to resample image:[/b][br]' . $image);
else message(__FILE__, __LINE__, 'error', '[b]Failed to resample image:[/b][br]Unsupported extension.');
- The file with the jpg extension isn't a jpg file
- The jpg file is corrupted
If this doesn't help send me the cover.jpg file by private message for examination.
Success CasN!
Re: failed to resample image
Hi Waldo,
that was the issue, it appeared to be a png-file. So a question of renaming and on to the next.
Thanks so far (bedankt!),
Cas
that was the issue, it appeared to be a png-file. So a question of renaming and on to the next.
Thanks so far (bedankt!),
Cas
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
This update creates a more meaningfull error message in the include/library_message.inc.php script around line 100
Code: Select all
if ($extension == 'jpg') $src_image = @imageCreateFromJpeg($image) or message(__FILE__, __LINE__, 'error', '[b]Failed to resample[/b][br]This is not a vallid JPG image:[br]' . $image);
elseif ($extension == 'png') $src_image = @imageCreateFromPng($image) or message(__FILE__, __LINE__, 'error', '[b]Failed to resample[/b][br]This is not a vallid PNG image:[br]' . $image);
else message(__FILE__, __LINE__, 'error', '[b]Failed to resample[/b][br]Unsupported or corrupted image:[br]' . $image);
Re: failed to resample image
I have replaced the existing code with these lines (hope I do not need it anymore ).
Re: failed to resample image
Also noticed that in case a cover image in not present, Netjukebox tries to obtain from the MP3 itself. Under windows the file extracted is not usable hence the update process stops. In my view the process should continue and the album should be added to the onces that need additional attention.
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
Thanks, I will look in this later.CasN wrote: ↑Sat Nov 11, 2023 4:28 pm Also noticed that in case a cover image in not present, Netjukebox tries to obtain from the MP3 itself. Under windows the file extracted is not usable hence the update process stops. In my view the process should continue and the album should be added to the onces that need additional attention.
Maybe you are willing to help me because I haven't a Windows (virtual) computer.
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
It could be that only on Windows the helper apps from getID3() are needed.CasN wrote: ↑Sat Nov 11, 2023 4:28 pm Also noticed that in case a cover image in not present, Netjukebox tries to obtain from the MP3 itself. Under windows the file extracted is not usable hence the update process stops. In my view the process should continue and the album should be added to the onces that need additional attention.
You can download the complete getID3() v1.9.16 (with helper apps) from:
https://github.com/JamesHeinrich/getID3 ... 1.9.16.zip
Would you be so kind to test it with the 1.9.16 package?
If it works you can of course try the latest 1.9.xx package.
On a live environment I should always delete the demo directory.
It is also save to delete the getid3/extension.cache.xxx.php files.
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
It is possible to (temporary) disable the image extraction in the config.inc.php file:CasN wrote: ↑Sat Nov 11, 2023 4:28 pm Also noticed that in case a cover image in not present, Netjukebox tries to obtain from the MP3 itself. Under windows the file extracted is not usable hence the update process stops. In my view the process should continue and the album should be added to the onces that need additional attention.
Code: Select all
$cfg['image_read_embedded'] = false;
Re: failed to resample image
I tried first adding the Windows helper apps, no luck. Next I downloaded the latest GetID3 and moved the downloaded helper apps to the bin directory, no luck. Next I switched of reading the embedded and this clearly worked.
I also have a folder image which I can use as the front cover so i am all set.
Windows is a system I use for day to day work (and trying out new software as well), my websites are under Ubuntu (where it is working without issues).
I also have a folder image which I can use as the front cover so i am all set.
Windows is a system I use for day to day work (and trying out new software as well), my websites are under Ubuntu (where it is working without issues).
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
Thanks for the help and infos!CasN wrote: ↑Mon Nov 13, 2023 1:54 pm I tried first adding the Windows helper apps, no luck. Next I downloaded the latest GetID3 and moved the downloaded helper apps to the bin directory, no luck. Next I switched of reading the embedded and this clearly worked.
I also have a folder image which I can use as the front cover so i am all set.
Windows is a system I use for day to day work (and trying out new software as well), my websites are under Ubuntu (where it is working without issues).
getID3() has its own directory for helperapps (without a bin directory): netjukebox/lib/getid3/helperapps/
I know it is confusing with also a netjukebox helper app directory, sorry
Could you try it again and place the getID3() helper apps in netjukebox/lib/getid3/helperapps/
Thanks!
Re: failed to resample image
Ok, tried that also but still get the same error message. I have attaached the (extracted) jpg file that is causing the issue
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Re: failed to resample image
Now I can reproduce the error message on Windows.
The same flac file with embedded jpg image extract correctly on Ubuntu.
These are the same findings you described.
If I have time again I will look into it.
For the meantime Windows users can disable reading embedded images:
PS
It dit took me a while to install Windows 11 ARM64 on a Mac mini M2.
With trail and error I discovered UTM and that did the trick.
https://docs.getutm.app/guides/windows/
The installation is much smoother than in the above guide.
The same flac file with embedded jpg image extract correctly on Ubuntu.
These are the same findings you described.
If I have time again I will look into it.
For the meantime Windows users can disable reading embedded images:
Code: Select all
$cfg['image_read_embedded'] = false;
It dit took me a while to install Windows 11 ARM64 on a Mac mini M2.
With trail and error I discovered UTM and that did the trick.
https://docs.getutm.app/guides/windows/
The installation is much smoother than in the above guide.
- wbartels
- netjukebox developer
- Posts: 881
- Joined: Thu Nov 04, 2004 3:12 pm
- Location: Netherlands
- Contact:
Moved
I will lock this topic because the first section has been a fix.
And the second section is moved to Windows related
And the second section is moved to Windows related