Skip to content
Browse files

[httpapi] depracate TakeScreenshot that has paramaters

  • Loading branch information...
1 parent 581fe30 commit 0f12c02ccb8953163d3eb02d1c9976e1fe5ca899 Jonathan Marshall committed Jul 1, 2012
Showing with 1 addition and 72 deletions.
  1. +1 −72 xbmc/interfaces/http-api/XBMChttp.cpp
View
73 xbmc/interfaces/http-api/XBMChttp.cpp
@@ -26,7 +26,6 @@
#include "video/VideoDatabase.h"
#include "guilib/GUIButtonControl.h"
#include "GUIInfoManager.h"
-#include "pictures/Picture.h"
#include "music/tags/MusicInfoTagLoaderFactory.h"
#include "music/infoscanner/MusicInfoScraper.h"
#include "addons/AddonManager.h"
@@ -2860,77 +2859,7 @@ int CXbmcHttp::xbmcTakeScreenshot(int numParas, CStdString paras[])
if (numParas<1)
CUtil::TakeScreenshot();
else
- {
- CStdString filepath;
- if (paras[0]=="")
- filepath = "special://temp/screenshot.jpg";
- else
- filepath = paras[0];
- if (numParas>5)
- {
- CStdString tmpFile = "special://temp/temp.png";
- CUtil::TakeScreenshot(tmpFile, true);
- int height, width;
- if (paras[4]=="")
- if (paras[3]=="")
- {
- return SetResponse(openTag+"Error:Both height and width parameters cannot be absent");
- }
- else
- {
- width=atoi(paras[3]);
- height=-1;
- }
- else
- if (paras[3]=="")
- {
- height=atoi(paras[4]);
- width=-1;
- }
- else
- {
- width=atoi(paras[3]);
- height=atoi(paras[4]);
- }
- int ret = CPicture::ConvertFile(tmpFile, filepath, (float) atof(paras[2]), width, height, atoi(paras[5]));
- if (ret == 0)
- {
- CFile::Delete(tmpFile);
- if (numParas>6)
- if (paras[6].ToLower()=="true")
- {
- CStdString b64="";
- int linesize=80;
- bool bImgTag=false;
- // only allow the old GetThumb command to accept "imgtag"
- if (numParas==8 && paras[7].Equals("imgtag"))
- {
- bImgTag=true;
- b64="<img src=\"data:image/jpg;base64,";
- linesize=0;
- }
- b64+=encodeFileToBase64(filepath,linesize);
- if (filepath == "special://temp/screenshot.jpg")
- CFile::Delete(filepath);
- if (bImgTag)
- {
- b64+="\" alt=\"Your browser doesnt support this\" title=\"";
- b64+=paras[0];
- b64+="\">";
- }
- return SetResponse(b64) ;
- }
- }
- else
- {
- CStdString strInt;
- strInt.Format("%", ret);
- return SetResponse(openTag+"Error:Could not convert image, error: " + strInt );
- }
- }
- else
- return SetResponse(openTag+"Error:Missing parameters");
- }
+ return SetResponse(openTag+"Error: xbmcTakeScreenshot with params depracated");
return SetResponse(openTag+"OK");
}

0 comments on commit 0f12c02

Please sign in to comment.
Something went wrong with that request. Please try again.