(define (script-fu-resize-upper-pot pattern)(let* ((filelist (cadr (file-glob pattern 1))))(while (not (null? filelist))(let* ((filename (car filelist))(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))(drawable (car (gimp-image-get-active-layer image)))) (let* ( ;; Store LOWER power of two for height and width of image (height (pow 2 (floor (/ (log (car (gimp-image-height image))) (log 2))))) (width (pow 2 (floor (/ (log (car (gimp-image-width image))) (log 2))))) )(gimp-message filename)(gimp-image-scale-full image width height INTERPOLATION-CUBIC))(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)(gimp-image-delete image))(set! filelist (cdr filelist)))))