#!/usr/bin/env python # -*- coding: utf-8 -*- try: import scribus except ImportError: print "Unable to import the 'scribus' module. This script will only run within" print "the Python interpreter embedded in Scribus. Try Script->Execute Script." sys.exit(1) try: from PIL import Image except ImportError: result = scribus.messageBox('PIL Error','Cannot import PIL',scribus.ICON_ERROR) sys.exit(1) imageload = scribus.fileDialog('Load image','Images(*.jpg *.png *.tif *.JPG *.PNG *.jpeg *.JPEG *.TIF)',haspreview=1) im = Image.open(imageload) xsize, ysize = im.size result = scribus.messageBox('Information about your image', 'width = ' + str(xsize) + ', ' + 'height = ' + str(ysize), scribus.BUTTON_OK) scribus.setRedraw(True)