Skip to content

Commit

Permalink
thumbnailing in jpeg for original bmp (and fix tiff case when extensi…
Browse files Browse the repository at this point in the history
…on in upper case)

git-svn-id: file:///root/var/svn/trunk/uploadr@576 2ccee060-bf41-0410-b5a3-d28fdbd3ea41
  • Loading branch information
Jerome Decq committed Mar 30, 2009
1 parent 9a796bf commit a1a46a9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions MacUploadr.app/Contents/Resources/components/flGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ extern "C" __declspec(dllexport) __checkReturn int __cdecl strcasecmp(__in_z
#include "afxinet.h"
//#include <Windows.h>
const DWORD dwChunckSize = 64 * 1024;

extern "C" __declspec(dllimport) UINT ___lc_codepage_func(void);

extern "C" unsigned int __lc_codepage = ___lc_codepage_func(); //I can't link without that !?????????????????
Expand Down Expand Up @@ -49,6 +48,7 @@ extern "C" {
#include <stdlib.h>
#include <sstream>
#include <string>
#include <cctype> // std::tolower
#include <sys/stat.h>
#include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h"
Expand Down Expand Up @@ -674,8 +674,12 @@ NS_IMETHODIMP flGM::Thumb(PRInt32 square, const nsAString & path, nsAString & _r
delete path_s; path_s = 0;

// If this image is a TIFF, force the thumbnail to be a JPEG
if (thumb_s->rfind(".tif") + 6 > thumb_s->length()) {
thumb_s->append(".jpg");
std::string thumbLowerCase(*thumb_s);
//thumbLowerCase.resize(thumbPath.length());
std::transform(thumb_s->begin(), thumb_s->end(), thumbLowerCase.begin(), tolower);
if (thumbLowerCase.rfind(".tif") + 6 > thumbLowerCase.length() ||
thumbLowerCase.rfind(".bmp") + 6 > thumbLowerCase.length()) {
thumb_s->append(".jpg");
}

// Find the sharpen sigma as the website does
Expand Down Expand Up @@ -1255,4 +1259,10 @@ NS_IMETHODIMP flGM::Cancel(PRBool bCancel)
{
gbCancel = (bCancel == PR_TRUE);
return NS_OK;
}
}

/* void sleep (in long tick); */
//NS_IMETHODIMP flGM::Sleep(PRInt32 tick)
//{
// return PR_Sleep(tick);
//}

0 comments on commit a1a46a9

Please sign in to comment.