mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsPicture: fix missing dimension values on wrong image location
In some constellations we can't get dimensions from getIconSize(), so it is useful to fall back to g_PicViewer->getSize(). Cache cleanup removed, can be done at runtime if required.
This commit is contained in:
@@ -152,6 +152,18 @@ void CComponentsPicture::initCCItem()
|
|||||||
if (!do_scale){
|
if (!do_scale){
|
||||||
//use image/icon size as object dimension values
|
//use image/icon size as object dimension values
|
||||||
frameBuffer->getIconSize(pic_name.c_str(), &width, &height);
|
frameBuffer->getIconSize(pic_name.c_str(), &width, &height);
|
||||||
|
|
||||||
|
/*if we have an image with full path => fallback to pv methode.
|
||||||
|
* That's always a cramp, why we don't have an unified solution in render classes?
|
||||||
|
*/
|
||||||
|
if (width == 0 || height == 0){
|
||||||
|
int dx_tmp, dy_tmp;
|
||||||
|
g_PicViewer->getSize(pic_name.c_str(), &dx_tmp, &dy_tmp);
|
||||||
|
if (width == 0)
|
||||||
|
width = dx_tmp;
|
||||||
|
if (height == 0)
|
||||||
|
height = dy_tmp;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else{ //initialized scaled size
|
else{ //initialized scaled size
|
||||||
@@ -169,10 +181,10 @@ void CComponentsPicture::initCCItem()
|
|||||||
//check dimensions, leave if dimensions are equal
|
//check dimensions, leave if dimensions are equal
|
||||||
if (width == dx && height == dy)
|
if (width == dx && height == dy)
|
||||||
return;
|
return;
|
||||||
|
#if 0
|
||||||
//clean up possible cache on changed dimensions
|
//clean up possible cache on changed dimensions
|
||||||
clearCache();
|
clearCache();
|
||||||
|
#endif
|
||||||
//temporarily vars
|
//temporarily vars
|
||||||
int w_2scale = width;
|
int w_2scale = width;
|
||||||
int h_2scale = height;
|
int h_2scale = height;
|
||||||
@@ -294,7 +306,6 @@ bool CComponentsPicture::hasChanges()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||||
const std::string& channelName,
|
const std::string& channelName,
|
||||||
const uint64_t& channelId,
|
const uint64_t& channelId,
|
||||||
|
Reference in New Issue
Block a user