Does anyone know if there’s a way I can resize an image/blob before I upload it to my database?
Here’s what I’m doing right now to upload/
import fpmi from java.net import URL from javax.imageio import ImageIO #set the id myID = event.source.parent.ComplaintId if myID != None: #prompt user to select file path = fpmi.file.openFile() #if user selects a file, and does not click cancel, do this if path != None: bytes = fpmi.file.readFileAsBytes(path) #write the data to the database, and return the id of the new row fpmi.db.runPrepStmt("INSERT INTO TBL_IMAGE (COMPLAINT_ID, IMAGEFILE) VALUES(?,?)", (myID,bytes))
I guess another question could also be; ‘Is there a way to scale an image with the printable canvas’? That might be easier since that’s where this will eventually be displayed.