Permalink
Browse files

[jpegloader] load based on m_fanartRes/m_imageRes instead of based on…

… screen res
  • Loading branch information...
1 parent 34f045a commit f87822973ac894e7995f30a8cfd30519f090ac8c Jonathan Marshall committed Jul 3, 2012
Showing with 13 additions and 6 deletions.
  1. +1 −2 xbmc/TextureCacheJob.cpp
  2. +12 −4 xbmc/guilib/JpegIO.cpp
View
@@ -119,8 +119,7 @@ CStdString CTextureCacheJob::DecodeImageURL(const CStdString &url, unsigned int
// unwrap the URL as required
CStdString image(url);
additional_info.clear();
- width = g_advancedSettings.m_fanartRes * 16/9;
- height = g_advancedSettings.m_fanartRes;
+ width = height = 0;
if (url.compare(0, 8, "image://") == 0)
{
// format is image://[type@]<url_encoded_path>?options
View
@@ -23,8 +23,7 @@
#include "lib/libexif/libexif.h"
#include "windowing/WindowingFactory.h"
-#include "settings/GUISettings.h"
-#include "settings/Settings.h"
+#include "settings/AdvancedSettings.h"
#include "filesystem/File.h"
#include "utils/log.h"
#include "XBTF.h"
@@ -312,9 +311,18 @@ bool CJpegIO::Read(unsigned char* buffer, unsigned int bufSize, unsigned int min
the gpu can hold, use the previous one.*/
if (minx == 0 || miny == 0)
{
- minx = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iWidth;
- miny = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iHeight;
+ miny = g_advancedSettings.m_imageRes;
+ if (g_advancedSettings.m_fanartRes > g_advancedSettings.m_imageRes)
+ { // a separate fanart resolution is specified - check if the image is exactly equal to this res
+ if (m_cinfo.image_width == (unsigned int)g_advancedSettings.m_fanartRes * 16/9 &&
+ m_cinfo.image_height == (unsigned int)g_advancedSettings.m_fanartRes)
+ { // special case for fanart res
+ miny = g_advancedSettings.m_fanartRes;
+ }
+ }
+ minx = miny * 16/9;
}
+
m_cinfo.scale_denom = 8;
m_cinfo.out_color_space = JCS_RGB;
unsigned int maxtexsize = g_Windowing.GetMaxTextureSize();

0 comments on commit f878229

Please sign in to comment.