Page 1 of 1

Image errors

Posted: Fri May 11, 2007 7:53 am
by Shizzle
When I run an update I seem to always get this error message:

Code: Select all

Error resample image:
then it would display the file name which was folder.gif. Is this because it is a gif and I need to save the image as a jpg?

I did get this error with folder.jpg as well though it was a completely different file

Posted: Fri May 11, 2007 10:42 am
by wbartels
Most likely the image files are corrupt.
In some rare situations there could be a problem with the image update.
I have already made some improvements to the image update section.
If you like you could already try it out.

Delete line 516-524 from update.php (netjukebox 4.00)

Code: Select all

$extension = substr(strrchr($image, '.'), 1);
$extension = strtolower($extension);

$src_image = @ImageCreateFromString($image);
if		($src_image !== false)	$extension = '';
elseif	($extension == 'jpg')	$src_image = @ImageCreateFromJpeg($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
elseif	($extension == 'png')	$src_image = @ImageCreateFromPng($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
elseif	($extension == 'gif')	$src_image = @ImageCreateFromGif($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
else	message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>Unknown extension or data.');
Replace it by:

Code: Select all

if (is_file($image))
	{
	$extension = substr(strrchr($image, '.'), 1);
	$extension = strtolower($extension);
	}
else
	$extension = '';

if		($extension == 'jpg')	$src_image = @ImageCreateFromJpeg($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
elseif	($extension == 'png')	$src_image = @ImageCreateFromPng($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
elseif	($extension == 'gif')	$src_image = @ImageCreateFromGif($image)	or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>' . $image);
else							$src_image = @ImageCreateFromString($image) or message(__FILE__, __LINE__, 'error', '<strong>Error resample image:</strong><br>Unknown extension or data.');

Re: Image errors

Posted: Thu Mar 12, 2009 6:54 pm
by Coolio472
I followed the above instructions because I was running into the same error. Now I get this error instead:

<strong>Error resample image:</strong><br>C:/****/*****/*****/****/cd_front.jpg

What do I do to resolve this? It looks more like a copy past error on my part but I don't know where it is.

Re: Image errors

Posted: Thu Mar 12, 2009 8:03 pm
by wbartels
Coolio472 wrote:I followed the above instructions because I was running into the same error. Now I get this error instead:

<strong>Error resample image:</strong><br>C:/****/*****/*****/****/cd_front.jpg

What do I do to resolve this? It looks more like a copy past error on my part but I don't know where it is.
Did you use the latest version of netjukebox?
If so I assume that your jpg image is corrupt or it is another file with the jpg extension.
Could you remove that particular image and update again?

Re: Image errors

Posted: Thu Mar 12, 2009 10:37 pm
by Coolio472
Got it. For some reason, the album art was on some songs in the album but not others. Removing the album art completely from the id3 tag resolved the issue. Thanks for your time!