summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-06-27 19:34:39 +0100
committerCho <cho@lindenlab.com>2013-06-27 19:34:39 +0100
commit26832818780ffe5052443db3c6bbfca15575a5b5 (patch)
tree05de8446bf07b64112c0e749357aacc71708bc73 /indra
parent1adc987ed1a90af1fdb4e14bf1ce1674a69389b9 (diff)
changed FBC photo sharing to use JPEG instead of PNG for ACME-636
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfacebookconnect.cpp23
-rw-r--r--indra/newview/llfloatersocial.cpp6
2 files changed, 20 insertions, 9 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index fe4e7fe69e..cf0f554149 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -36,6 +36,7 @@
#include "llnotificationsutil.h"
#include "llurlaction.h"
#include "llimagepng.h"
+#include "llimagejpeg.h"
#include "lltrans.h"
@@ -352,14 +353,22 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri
void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption)
{
- // All this code is mostly copied from LLWebProfile::post()
- if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
+ std::string imageFormat;
+ if (dynamic_cast<LLImagePNG*>(image.get()))
+ {
+ imageFormat = "png";
+ }
+ else if (dynamic_cast<LLImageJPEG*>(image.get()))
+ {
+ imageFormat = "jpg";
+ }
+ else
{
- llwarns << "Image to upload is not a PNG" << llendl;
- llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0);
+ llwarns << "Image to upload is not a PNG or JPEG" << llendl;
return;
}
-
+
+ // All this code is mostly copied from LLWebProfile::post()
const std::string boundary = "----------------------------0123abcdefab";
LLSD headers;
@@ -373,8 +382,8 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
<< caption << "\r\n";
body << "--" << boundary << "\r\n"
- << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot.png\"\r\n"
- << "Content-Type: image/png\r\n\r\n";
+ << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << imageFormat << "\"\r\n"
+ << "Content-Type: image/" << imageFormat << "\r\n\r\n";
// Insert the image data.
// *FIX: Treating this as a string will probably screw it up ...
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 7ef8f9f9e3..e305bfd10a 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -137,7 +137,7 @@ BOOL LLSocialPhotoPanel::postBuild()
mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
-
+
LLRect full_screen_rect = getRootView()->getRect();
LLSnapshotLivePreview::Params p;
p.rect(full_screen_rect);
@@ -145,8 +145,10 @@ BOOL LLSocialPhotoPanel::postBuild()
mPreviewHandle = previewp->getHandle();
previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+ previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+ //previewp->setSnapshotQuality(98);
previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect());
-
+
return LLPanel::postBuild();
}