Changeset 576

Show
Ignore:
Timestamp:
03/30/09 15:15:19 (8 months ago)
Author:
jdecq
Message:

thumbnailing in jpeg for original bmp (and fix tiff case when extension in upper case)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/flGM.cpp

    r532 r576  
    2222//#include <Windows.h> 
    2323const DWORD dwChunckSize = 64 * 1024; 
    24  
    2524extern "C" __declspec(dllimport) UINT ___lc_codepage_func(void); 
    2625 
     
    5049#include <sstream> 
    5150#include <string> 
     51#include <cctype>       // std::tolower 
    5252#include <sys/stat.h> 
    5353#include "nsCOMPtr.h" 
     
    675675 
    676676                // If this image is a TIFF, force the thumbnail to be a JPEG 
    677                 if (thumb_s->rfind(".tif") + 6 > thumb_s->length()) { 
    678                         thumb_s->append(".jpg"); 
     677                std::string thumbLowerCase(*thumb_s); 
     678                //thumbLowerCase.resize(thumbPath.length()); 
     679                std::transform(thumb_s->begin(), thumb_s->end(), thumbLowerCase.begin(), tolower); 
     680                if (thumbLowerCase.rfind(".tif") + 6 > thumbLowerCase.length() || 
     681                        thumbLowerCase.rfind(".bmp") + 6 > thumbLowerCase.length()) { 
     682                                thumb_s->append(".jpg"); 
    679683                } 
    680684 
     
    12571261    return NS_OK; 
    12581262} 
     1263 
     1264/* void sleep (in long tick); */ 
     1265//NS_IMETHODIMP flGM::Sleep(PRInt32 tick) 
     1266//{ 
     1267//      return PR_Sleep(tick); 
     1268//}