Image errors

Fixed and closed topics
Locked
Shizzle
User
Posts: 65
Joined: Sat May 28, 2005 9:00 am
Location: Gresham, OR USA
Contact:

Image errors

Post 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
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post 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.');
Coolio472
User
Posts: 2
Joined: Thu Mar 12, 2009 6:53 pm

Re: Image errors

Post 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.
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Image errors

Post 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?
Coolio472
User
Posts: 2
Joined: Thu Mar 12, 2009 6:53 pm

Re: Image errors

Post 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!
Locked