def _load_megapixels(self,directory):
        """Opens megapixel file, if contains '3.5' for instance,
        will scale all uploaded photos in directory this this size,
        the original photo is untouched. Returns None if
        file not found
        
        """
        #FIXME: should check if DB tracking file before using it

        fullfile=os.path.join(directory,MEGAPIXEL_FILE)
        try:
            mp=float(open(fullfile).readline())
            logger.debug("_load_megapixel: MP from file is %f",mp)
        except:
            logger.warning("Couldn't open image size file in %s, not scaling images"\
                    %(directory))
            return None

        return mp
def _load_megapixels ( self , directory ) : fullfile = os . path . join ( directory , MEGAPIXEL_FILE ) try : mp = float ( open ( fullfile ) . readline ( ) ) logger . debug ( "_load_megapixel: MP from file is %f" , mp ) except : logger . warning ( "Couldn't open image size file in %s, not scaling images" % ( directory ) ) return None return mp
Opens megapixel file, if contains '3.5' for instance,
        will scale all uploaded photos in directory this this size,
        the original photo is untouched. Returns None if
        file not found