SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations > Batch Metadata Tools
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

Batch Metadata Tools This forums is for discussing the user-created Batch Metadata Tools for SageTV.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 02-15-2011, 07:24 AM
Spectrum Spectrum is offline
Sage Expert
 
Join Date: Aug 2006
Posts: 720
Bizarre! All of the images are in the RGB colorspace. They aren't using CMYK/HSL which is what I would expect to show a radical color shift like that. If you have image magick installed you can show the colorspace of the image via 'identify -verbose image.jpg' and it will spit out the colorspace along with a bunch of other info. Photoshop can determine the colorspace as well and Gimp probably can too.

May just have to manually fix these as they show up
Reply With Quote
  #22  
Old 02-15-2011, 07:50 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by Spectrum View Post
May just have to manually fix these as they show up
or somehow detect them and either just delete them and redownload a different one... or detect, save with some external program to fix the problem...
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #23  
Old 02-15-2011, 08:40 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Spectrum View Post
Bizarre! All of the images are in the RGB colorspace. They aren't using CMYK/HSL which is what I would expect to show a radical color shift like that. If you have image magick installed you can show the colorspace of the image via 'identify -verbose image.jpg' and it will spit out the colorspace along with a bunch of other info. Photoshop can determine the colorspace as well and Gimp probably can too.

May just have to manually fix these as they show up
Quote:
Originally Posted by razrsharpe View Post
or somehow detect them and either just delete them and redownload a different one... or detect, save with some external program to fix the problem...
I'd love to detect them... but the issue is that as Spectrum noted, the color space does appear to be correct. The "fixes" listed rely on detecting the colorspace and handing it differently, but in my testing, it would never trigger the alternate colorspace logic. There is something in the images that Java ImageIO.read() does not like, but I can't really seem to figure what it is.

In my testing... I'd do..
Code:
BufferedImage i = ImageIO.read(file);
ImageIO.write(i, "jpg", newfile);
And the resulting image would be corrupt. Since I can't control those 2 operations, it's very hard for me to solve this issue I tried to find some alternate apis for reading/writing images in java, but I can't find anything that is portable and many simply wrap ImageIO.read/write.
Reply With Quote
  #24  
Old 02-15-2011, 09:06 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by stuckless View Post
In my testing... I'd do..
Code:
BufferedImage i = ImageIO.read(file);
ImageIO.write(i, "jpg", newfile);
And the resulting image would be corrupt. Since I can't control those 2 operations, it's very hard for me to solve this issue I tried to find some alternate apis for reading/writing images in java, but I can't find anything that is portable and many simply wrap ImageIO.read/write.
In my head i had something way less elegant, where basically you would:
  • when initially downloading the images
  • save the file from tvdb (i think basically like you do because at this point i don't think the image is corrupt yet....
  • then since we can't detect which images are bad, we would have to open, save, and close all the images as they're downloaded with an editor from the command line (since you said that's how you fixed it...)... (maybe imagemagick, never used it but it looks like its a command line image editor that runs on unix, mac os x, and windows and would fit the bill ... looks like there is also a java interface for directly calling imagemagick from java)
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #25  
Old 02-15-2011, 11:19 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Yeah, I've looked at the image magic stuff before. I personally have never run into this issue, but I know several other have. What I may do, it add an image download hook to the fanart download process, thta can hand the image off another process once it's downloaded. That way, some people could have it run through an image processor that simply loads and saves the image using some other tool.

I'll take a look at image magic again as well.
Reply With Quote
  #26  
Old 02-15-2011, 03:11 PM
Spectrum Spectrum is offline
Sage Expert
 
Join Date: Aug 2006
Posts: 720
I used groovy as a way into the classes and it looks like the offending images are distorted when they are read in. I tried writing one out to a bmp and it was distorted. Unfortunately in the imageio class, there is no way to specify the reader type. It is chosen automagically so it looks like there is no way to forcefully say read this image, it's a jpeg, and it's in the RGB colorspace.

I tried digging into the bufferedimage class a little bit, but couldn't get find a straight answer on how to examine the colorspace of an image. There is a colorspace property, but it just goes to another class and doesn't look like it can be simply printed out to determine what colorspace the image is in. I haven't done much java programming (groovy scripting for SJQ is really about it) but this is reminiscent of dependency hell in linux 10 years ago. Oh you want to look at this property, that's another class. But that class is a sub-class of another sub-class of another sub-class By the time I've looked up the properties on the 5th subclass I've forgotten wtf I was originally looking for!

Not a very elegant solution, but hooking into an external converter for jpegs may be the only option
Reply With Quote
  #27  
Old 02-24-2011, 07:51 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
just thinking about this again.... bmt 3.x never had this issue with scaling/transforming images... so did something change on your end (ie how bmt was fetching/caching/saving the images)? or do you think (more likely probably) that the problem has always been there but more people are now creating images for tvdb using a colorspace that java doesnt like?
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #28  
Old 02-24-2011, 08:00 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by razrsharpe View Post
just thinking about this again.... bmt 3.x never had this issue with scaling/transforming images... so did something change on your end (ie how bmt was fetching/caching/saving the images)? or do you think (more likely probably) that the problem has always been there but more people are now creating images for tvdb using a colorspace that java doesnt like?
The problem has always been there... it's more likely that something has changed in how people are createing the backgrounds, etc.

Since the issue is in the core java ImageIO apis... i've spoken with sagetv to see if they can expose their image apis so that I can use them, instead of the java apis. Once that happens, the phoenix apis will be modified to use the new load/save methods and it should solve this issue.
Reply With Quote
  #29  
Old 02-24-2011, 08:02 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by stuckless View Post
The problem has always been there... it's more likely that something has changed in how people are createing the backgrounds, etc.
figured that was the case but wanted to double check

Quote:
Since the issue is in the core java ImageIO apis... i've spoken with sagetv to see if they can expose their image apis so that I can use them, instead of the java apis. Once that happens, the phoenix apis will be modified to use the new load/save methods and it should solve this issue.
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #30  
Old 02-24-2011, 10:11 AM
Spectrum Spectrum is offline
Sage Expert
 
Join Date: Aug 2006
Posts: 720
Would there be any point in filing a bug report with Oracle about the imageIO library? It seems that it has problems with these images when nothing else I've found does. Heck even mspaint can read them fine!
Reply With Quote
  #31  
Old 02-24-2011, 12:14 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Spectrum View Post
Would there be any point in filing a bug report with Oracle about the imageIO library? It seems that it has problems with these images when nothing else I've found does. Heck even mspaint can read them fine!
Some bright folks already did that... apparently it wasn't a priority for Sun... and it's even less of a priority for Oracle

Once we get to use the exposed sagetv apis, then it will be better all around. I'm sure the native apis for loading/scaling/saving are more efficient than the java based apis.
Reply With Quote
  #32  
Old 10-28-2011, 01:01 PM
vividweb vividweb is offline
Sage Aficionado
 
Join Date: Aug 2006
Location: Calgary AB
Posts: 401
was this ever resolved? I am starting to see this more and more.
__________________

Sage Server: i5-2500K 8 GB DDR, 6000gb HDD, 4xHD-PVR < 4xBell 6141, Win7 x64
Client 1: HD-200, Panasonic 42PX75
Client 2: HD-300, Samsung LCD
Client 3: HD-300, Samsung PN50C550
Client 4: MS Surface Pro
Reply With Quote
  #33  
Old 10-28-2011, 05:59 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Yeah, I'm pretty sure it has been resolved for many months now... I haven't seen a corrupt file in ages. Are you running the latest sagetv/bmt/phoenix?
Reply With Quote
  #34  
Old 10-29-2011, 03:06 PM
vividweb vividweb is offline
Sage Aficionado
 
Join Date: Aug 2006
Location: Calgary AB
Posts: 401
yeah using the latest according to the plugins. It is a new install. My internet connection can be a little shaky, so that might be the cause.
__________________

Sage Server: i5-2500K 8 GB DDR, 6000gb HDD, 4xHD-PVR < 4xBell 6141, Win7 x64
Client 1: HD-200, Panasonic 42PX75
Client 2: HD-300, Samsung LCD
Client 3: HD-300, Samsung PN50C550
Client 4: MS Surface Pro
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Poster view crashing - Help please PhilH Sage My Movies 3 11-11-2010 11:53 AM
Default poster when there is no fanart Oats SageMC Custom Interface 0 10-21-2010 04:53 PM
Poster not showing up as Thumb technazz SageMC Custom Interface 0 09-24-2009 07:01 AM
Poster art not showing veger69 SageMC Custom Interface 5 07-20-2009 10:06 AM


All times are GMT -6. The time now is 03:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.