All pastes #588850 Raw Edit

Stuff

public text v1 · immutable
#588850 ·published 2007-06-25 18:46 UTC
rendered paste body
                # Create tempfile
                temp_filename = "c:\\vtscans\\thumbtmp.bmp"
                pdb.file_bmp_save(image, 
                                  image.active_drawable, 
                                  temp_filename, 
                                  temp_filename)
                
                # Get Thumbnail Properties
                x_scale = 72/xres
                y_scale = 72/yres
                new_width = width * x_scale
                new_height = height * y_scale
                
                # Create Thumbnail
                imfile = temp_filename
                im = Image.open(imfile)
                im = im.resize((new_width, new_height), Image.BICUBIC)
                im.save("c:\\vtscans\\thumb1.jpg")
    
                # Remove Temporary Bitmap
                os.remove(temp_filename)