diff --git a/HISTORY b/HISTORY index 8973546..3adf0f9 100644 --- a/HISTORY +++ b/HISTORY @@ -87,3 +87,4 @@ Version 0.0.5 - added {newmails} Token in displaychannel statusinfo, mailbox plugin has to be installed - clearing displaymessage if it is called without text +- changed handling of channel logos, width and height are now mandatory diff --git a/config.c b/config.c index 7052f50..71c9387 100644 --- a/config.c +++ b/config.c @@ -11,9 +11,6 @@ cDesignerConfig::cDesignerConfig() { limitLogoCache = 1; numLogosMax = 200; debugImageLoading = 0; - //default logo width and height - logoWidth = 268; - logoHeight = 200; replaceDecPoint = false; //settings for rerun display rerunAmount = 10; @@ -86,12 +83,6 @@ bool cDesignerConfig::GetSkin(string &skin) { return true; } -void cDesignerConfig::SetChannelLogoSize(void) { - cImageLoader imgLoader; - imgLoader.DeterminateChannelLogoSize(logoWidth, logoHeight); - dsyslog("skindesigner: using %dx%d px as original channel logo size", logoWidth, logoHeight); -} - void cDesignerConfig::CheckDecimalPoint(void) { struct lconv *pLocInfo; pLocInfo = localeconv(); diff --git a/config.h b/config.h index 3a031c0..fe5c991 100644 --- a/config.h +++ b/config.h @@ -36,7 +36,6 @@ public: void ReadSkins(void); void InitSkinIterator(void) { skinIterator = skins.begin(); }; bool GetSkin(string &skin); - void SetChannelLogoSize(void); void CheckDecimalPoint(void); void SetSkin(void); bool SkinChanged(void); @@ -55,8 +54,6 @@ public: int limitLogoCache; int numLogosMax; int debugImageLoading; - int logoWidth; - int logoHeight; bool replaceDecPoint; char decPoint; vector skins; diff --git a/designer.c b/designer.c index 3cd787c..5da39d6 100644 --- a/designer.c +++ b/designer.c @@ -177,7 +177,6 @@ void cSkinDesigner::Init(void) { } dsyslog("skindesigner: initializing skin %s", skin.c_str()); - config.SetChannelLogoSize(); config.CheckDecimalPoint(); if (fontManager) diff --git a/displaymessage.c b/displaymessage.c index 9d2ebed..ad3d47f 100644 --- a/displaymessage.c +++ b/displaymessage.c @@ -25,8 +25,8 @@ cSDDisplayMessage::~cSDDisplayMessage() { void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) { if (!doOutput) return; + messageView->ClearMessage(); if (!Text) { - messageView->ClearMessage(); return; } messageView->DrawMessage(Type, Text); diff --git a/dtd/functions.dtd b/dtd/functions.dtd index 424378f..27ba561 100644 --- a/dtd/functions.dtd +++ b/dtd/functions.dtd @@ -133,8 +133,8 @@ GetImageSize(w, h); if (width == 0) @@ -92,43 +91,6 @@ bool cImageLoader::LoadImage(std::string Path, std::string FileName, std::string return LoadImage(imgFile.c_str()); } -void cImageLoader::DeterminateChannelLogoSize(int &width, int &height) { - cString logoPath; - cString logoPathSkin = cString::sprintf("%s%s/themes/%s/logos/", *config.skinPath, Setup.OSDSkin, Setup.OSDTheme); - - if (FolderExists(*logoPathSkin)) - logoPath = logoPathSkin; - else - logoPath = config.logoPath; - - DIR *folder = NULL; - struct dirent *file; - folder = opendir(logoPath); - if (!folder) - return; - - while ( (file = readdir(folder)) ) { - if (endswith(file->d_name, ".png") || - endswith(file->d_name, ".svg")) { - std::stringstream filePath; - filePath << *logoPath << file->d_name; - if (LoadImage(filePath.str().c_str())) { - int logoWidth = 0; - int logoHeight = 0; - importer->GetImageSize(logoWidth, logoHeight); - if (logoWidth > 0 && logoHeight > 0) { - width = logoWidth; - height = logoHeight; - delete(importer); - importer = NULL; - return; - } - } - } - } -} - - // // Image importer for PNG // diff --git a/libcore/imageloader.h b/libcore/imageloader.h index a06f433..64eea07 100644 --- a/libcore/imageloader.h +++ b/libcore/imageloader.h @@ -76,7 +76,6 @@ public: cImage *CreateImage(int width, int height, bool preserveAspect = true); bool LoadImage(std::string Path, std::string FileName, std::string Extension); bool LoadImage(const char *fullpath); - void DeterminateChannelLogoSize(int &width, int &height); }; #endif //__NOPACITY_IMAGELOADER_H diff --git a/libtemplate/templatefunction.c b/libtemplate/templatefunction.c index 2a6e5a3..8465961 100644 --- a/libtemplate/templatefunction.c +++ b/libtemplate/templatefunction.c @@ -305,24 +305,6 @@ bool cTemplateFunction::ReCalculateParameters(void) { void cTemplateFunction::CompleteParameters(void) { switch (type) { case ftDrawImage: { - //Calculate img size - if ((GetNumericParameter(ptImageType) == itChannelLogo)||(GetNumericParameter(ptImageType) == itSepLogo)) { - int logoWidthOrig = config.logoWidth; - int logoHeightOrig = config.logoHeight; - int logoWidth = GetNumericParameter(ptWidth); - int logoHeight = GetNumericParameter(ptHeight); - if (logoWidth <= 0 && logoHeight <= 0) - break; - if (logoWidth <= 0 && logoHeightOrig > 0) { - logoWidth = logoHeight * logoWidthOrig / logoHeightOrig; - numericParameters.erase(ptWidth); - numericParameters.insert(pair(ptWidth, logoWidth)); - } else if (logoHeight <= 0 && logoWidthOrig > 0) { - logoHeight = logoWidth * logoHeightOrig / logoWidthOrig; - numericParameters.erase(ptHeight); - numericParameters.insert(pair(ptHeight, logoHeight)); - } - } CalculateAlign(GetNumericParameter(ptWidth), GetNumericParameter(ptHeight)); if (imgPath.size() == 0) { imgPath = GetParameter(ptPath); diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index e4a0409..4effefb 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -31,7 +31,7 @@ - + @@ -150,7 +150,7 @@ --> - + diff --git a/skins/metrixhd/xmlfiles/displaymenuchannels.xml b/skins/metrixhd/xmlfiles/displaymenuchannels.xml index baeae4b..3e6f771 100644 --- a/skins/metrixhd/xmlfiles/displaymenuchannels.xml +++ b/skins/metrixhd/xmlfiles/displaymenuchannels.xml @@ -28,7 +28,7 @@ - + @@ -84,7 +84,7 @@ --> - + diff --git a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml index a66ba86..39bd991 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml @@ -119,7 +119,7 @@ --> - + @@ -284,7 +284,7 @@ - + diff --git a/skins/metrixhd/xmlfiles/displaymenumain.xml b/skins/metrixhd/xmlfiles/displaymenumain.xml index 818f054..a13c94b 100644 --- a/skins/metrixhd/xmlfiles/displaymenumain.xml +++ b/skins/metrixhd/xmlfiles/displaymenumain.xml @@ -159,7 +159,7 @@ - + diff --git a/skins/metrixhd/xmlfiles/displaymenuschedules.xml b/skins/metrixhd/xmlfiles/displaymenuschedules.xml index 42169eb..08c6070 100644 --- a/skins/metrixhd/xmlfiles/displaymenuschedules.xml +++ b/skins/metrixhd/xmlfiles/displaymenuschedules.xml @@ -16,7 +16,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -92,7 +92,7 @@ - + diff --git a/skins/metrixhd/xmlfiles/displaymenutimers.xml b/skins/metrixhd/xmlfiles/displaymenutimers.xml index 8fb5856..607de90 100644 --- a/skins/metrixhd/xmlfiles/displaymenutimers.xml +++ b/skins/metrixhd/xmlfiles/displaymenutimers.xml @@ -68,7 +68,7 @@ --> - + diff --git a/skins/nopacity/xmlfiles/displaychannel.xml b/skins/nopacity/xmlfiles/displaychannel.xml index 00c5308..0209dd8 100644 --- a/skins/nopacity/xmlfiles/displaychannel.xml +++ b/skins/nopacity/xmlfiles/displaychannel.xml @@ -23,7 +23,7 @@ --> - + @@ -151,7 +151,7 @@ --> - + diff --git a/skins/nopacity/xmlfiles/displaymenuchannels.xml b/skins/nopacity/xmlfiles/displaymenuchannels.xml index 101de5d..b90ece5 100644 --- a/skins/nopacity/xmlfiles/displaymenuchannels.xml +++ b/skins/nopacity/xmlfiles/displaymenuchannels.xml @@ -35,7 +35,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/skins/nopacity/xmlfiles/displaymenudetailepg.xml b/skins/nopacity/xmlfiles/displaymenudetailepg.xml index 2ceb561..32e7c17 100644 --- a/skins/nopacity/xmlfiles/displaymenudetailepg.xml +++ b/skins/nopacity/xmlfiles/displaymenudetailepg.xml @@ -44,7 +44,7 @@ - + @@ -192,7 +192,7 @@ - + diff --git a/skins/nopacity/xmlfiles/displaymenumain.xml b/skins/nopacity/xmlfiles/displaymenumain.xml index 8ff53e5..b3ea9c0 100644 --- a/skins/nopacity/xmlfiles/displaymenumain.xml +++ b/skins/nopacity/xmlfiles/displaymenumain.xml @@ -38,7 +38,7 @@ - + diff --git a/skins/nopacity/xmlfiles/displaymenuschedules.xml b/skins/nopacity/xmlfiles/displaymenuschedules.xml index eae8e9d..8330e4d 100644 --- a/skins/nopacity/xmlfiles/displaymenuschedules.xml +++ b/skins/nopacity/xmlfiles/displaymenuschedules.xml @@ -13,7 +13,7 @@
- +
@@ -78,7 +78,7 @@
- + @@ -104,7 +104,7 @@ - + diff --git a/skins/nopacity/xmlfiles/displaymenutimers.xml b/skins/nopacity/xmlfiles/displaymenutimers.xml index 38274a3..db53f5d 100644 --- a/skins/nopacity/xmlfiles/displaymenutimers.xml +++ b/skins/nopacity/xmlfiles/displaymenutimers.xml @@ -35,7 +35,7 @@ - +