SageTV Community  

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

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-30-2016, 03:33 AM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
Weird sagex api image problem

Hi

When I call an image using sagex api Mediahandler, the colours in the images are being transformed:

'CaptureA' below is what the channel logo should look like (png file) - 'CaptureB' is what is produced using ...sagex/media/logo/BBC4

'CaptureC' is produced by a sagex call .../sagex/media/poster/10670613 and is fine
'CaptureD' is produced by call .../sagex/media/thumbnail/10670613 and isn't.

I have no idea what I, or it, is doing wrong. Does anyone have a suggestion?

thanks

syrel
Attached Images
File Type: jpg Capturea.JPG (10.5 KB, 148 views)
File Type: jpg Captureb.JPG (10.5 KB, 153 views)
File Type: jpg Capturec.JPG (25.0 KB, 146 views)
File Type: jpg Captured.JPG (22.0 KB, 156 views)
Reply With Quote
  #2  
Old 04-30-2016, 04:32 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
So Capture B and D are using sagetv apis to load a SageTV image and then uses java ImageIO class to transform it into the final file to send.

Capture C uses the phoenix APIs (since this is fanart) and because no other operations are specified it will send the file that is stored on disk. I wonder if you would have similar issues if you add thed the scalex parameter, something like, "&scalex=50", since that would force it through the ImageIO library.

This is unfortunately a command problem It doesn't do this for all images, but every now and then, some images come out exactly like you have shown. There is something in the source image that triggers this, but I have no idea what it might be.

The source code for the "phoenix" handlers is located here..
https://github.com/stuckless/sagetv-...stHandler.java

And the code that transforms a sagetv image blob into jpg/png is here..
https://github.com/stuckless/sagetv-...dler.java#L222

I suspect that maybe different versions of java might also have different effects, since, this seems like a bug in the ImageIO handling.
Reply With Quote
  #3  
Old 04-30-2016, 06:27 AM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
Thanks for the reply Stuckless. I had assumed that Phoenix must be the explanation for the correct version. Is there any way to call channel logos via phoenix?

I can confirm that this effect occurs on every image that I call via the sage apis. I've tried different file formats, colour depths, whatever I can think of to find a way, but it gives the image a pink wash every single time.

Unfortunately, I'm not a coder and so won't be able to do anything with the source code: the reason it's affecting me is because I use the xbmc plugin - I've learned to hack a bit of python via trial and error, but java is beyond me.

I could update java if you think it will make a difference - I'm still on 6.10. I'll need to take a system backup before I do, though, as updating caused me a lot of sage headaches last time (hence me sticking with 6.10!).

syrel

Last edited by syrel; 04-30-2016 at 06:47 AM.
Reply With Quote
  #4  
Old 04-30-2016, 06:48 AM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
Your advice has helped me to find out a bit more about the problem, though:

http://stackoverflow.com/questions/4...write-jpg-file

So now I have a rough idea of how to fix it, I just don't know how to do it!

syrel
Reply With Quote
  #5  
Old 04-30-2016, 08:26 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by syrel View Post
Your advice has helped me to find out a bit more about the problem, though:

http://stackoverflow.com/questions/4...write-jpg-file

So now I have a rough idea of how to fix it, I just don't know how to do it!

syrel
Unfortunately, for these fixes to work, I have to load the image myself, but in the case of sagetv images (logos, thumbanils,etc), they are given to me in a loaded state. I'm not sure that there is much that I can do, easily, here.

I would try to run java 7 and see if you have the same issues.
Reply With Quote
  #6  
Old 04-30-2016, 08:33 AM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
So the suggestion here http://stackoverflow.com/a/6075213 of adding TYPE_INT_RGB would not work? I was looking at adding it to (maybe) L227:

BufferedImage img = Utility.GetImageAsBufferedImage(sageImage);

but if you're saying that still wouldn't work, I'll stop trying to make it up...



PS- upgrading to Java 7 has not helped

Last edited by syrel; 04-30-2016 at 08:58 AM.
Reply With Quote
  #7  
Old 04-30-2016, 12:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by syrel View Post
So the suggestion here http://stackoverflow.com/a/6075213 of adding TYPE_INT_RGB would not work? I was looking at adding it to (maybe) L227:

BufferedImage img = Utility.GetImageAsBufferedImage(sageImage);

but if you're saying that still wouldn't work, I'll stop trying to make it up...



PS- upgrading to Java 7 has not helped
The challenge is the Utility.GetImage... returns a BufferedImage and in the samples that you posted, you are creating, from scratch, a BufferedImage. So once you have a buffered image, you'd have to determine (somehow) that it's bad, and fix it.

In your Sage.properties... try setting
Code:
ui/load_images_with_awt_toolkit=true
and then
Code:
ui/load_images_with_awt_toolkit=false
It looks like the core sagetv image utils is trying to account for some jpeg loadling issues as well. I'd play with toggling that setting and see what happens.

Note you have to have sagetv shutdown before you modify the Sage.properties.
Reply With Quote
  #8  
Old 04-30-2016, 01:19 PM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
It was already set to true; I toggled it to false but made no difference. Thanks for trying to find a solution though.

syrel
Reply With Quote
  #9  
Old 04-30-2016, 01:21 PM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
Quote:
Originally Posted by stuckless View Post
The challenge is the Utility.GetImage... returns a BufferedImage and in the samples that you posted, you are creating, from scratch, a BufferedImage. So once you have a buffered image, you'd have to determine (somehow) that it's bad, and fix it.
Given that I know that all images are bad, is there a standard line I could insert to fix it? Or is it that we know it's bad, but we don't know exactly how it's bad?

thanks

syrel
Reply With Quote
  #10  
Old 05-01-2016, 07:45 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by syrel View Post
Given that I know that all images are bad, is there a standard line I could insert to fix it? Or is it that we know it's bad, but we don't know exactly how it's bad?

thanks

syrel
I don't feel this is a simple fix. Personally based on the fixes that you posted and looking at the server code, I thought that setting the sagetv property would have fixed this (since what it does is what one of the fixes suggested).
Reply With Quote
  #11  
Old 05-01-2016, 08:16 AM
syrel syrel is offline
Sage Advanced User
 
Join Date: Oct 2010
Location: UK
Posts: 89
OK, guess I'll have to get used to rose tinted logos then. Thanks for looking at it.

syrel

EDIT:

I have found a workaround - I've edited the python script so that it requests channel logos via my ftp server, which means I can access them directly.

Last edited by syrel; 05-02-2016 at 04:11 AM.
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
sagex-api Plugin MISSING: sagex-api-FAILED http://ubuntone.com/5NNCHGlywxvXBgRw8B3nMr antplugger SageTV v7 Customizations 10 06-10-2014 01:34 AM
Weird aspect problem with HD-PVR 1point8turbo Hardware Support 4 02-27-2011 01:23 PM
Weird Problem mbrown3 SageTV Software 20 10-12-2005 04:06 PM


All times are GMT -6. The time now is 06:54 PM.


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