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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 0c67739074
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-01-19 (Tue, 19 Jan 2016)



------------------
This commit was generated by Migit
This commit is contained in:
2016-01-19 11:16:43 +01:00
committed by Michael Liebmann
parent 1ff26df09f
commit e7ba1ac2b6

View File

@@ -152,6 +152,18 @@ void CComponentsPicture::initCCItem()
if (!do_scale){
//use image/icon size as object dimension values
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;
}
else{ //initialized scaled size
@@ -169,10 +181,10 @@ void CComponentsPicture::initCCItem()
//check dimensions, leave if dimensions are equal
if (width == dx && height == dy)
return;
#if 0
//clean up possible cache on changed dimensions
clearCache();
#endif
//temporarily vars
int w_2scale = width;
int h_2scale = height;
@@ -294,7 +306,6 @@ bool CComponentsPicture::hasChanges()
return ret;
}
CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h,
const std::string& channelName,
const uint64_t& channelId,