return true;
}
#endif
- CBaseTexture *texture = LoadImage(image, width, height, additional_info);
+ CBaseTexture *texture = LoadImage(image, width, height, additional_info, true);
if (texture)
{
if (texture->HasAlpha())
image = thumbURL.GetHostName();
- CStdString optionString = thumbURL.GetOptions().Mid(1);
- optionString.TrimRight('/'); // in case XBMC adds a slash
+ CStdString optionString = thumbURL.GetOptions().empty() ? "" : thumbURL.GetOptions().substr(1);
+ StringUtils::TrimRight(optionString, "/"); // In case XBMC adds a slash.
std::vector<CStdString> options;
StringUtils::SplitString(optionString, "&", options);
for (std::vector<CStdString>::iterator i = options.begin(); i != options.end(); i++)
{
CStdString option, value;
- int pos = i->Find('=');
- if (pos != -1)
+ size_t pos = i->find('=');
+ if (pos != std::string::npos)
{
- option = i->Left(pos);
- value = i->Mid(pos + 1);
+ option = i->substr(0, pos);
+ value = i->substr(pos + 1);
}
else
{
return image;
}
-CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int width, unsigned int height, const std::string &additional_info)
+CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int width, unsigned int height, const std::string &additional_info, bool requirePixels)
{
if (additional_info == "music")
{ // special case for embedded music images
&& !StringUtils::StartsWithNoCase(file.GetMimeType(), "image/") && !file.GetMimeType().Equals("application/octet-stream")) // ignore non-pictures
return NULL;
- CBaseTexture *texture = CBaseTexture::LoadFromFile(image, width, height, CSettings::Get().GetBool("pictures.useexifrotation"));
+ CBaseTexture *texture = CBaseTexture::LoadFromFile(image, width, height, CSettings::Get().GetBool("pictures.useexifrotation"), requirePixels, file.GetMimeType());
if (!texture)
return NULL;