This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION resize(image bytea, h integer, w integer) | |
RETURNS bytea | |
LANGUAGE plpythonu | |
AS $function$ | |
if ('io' in SD) and ('StringIO' in SD) and ('Image' in SD): | |
io = SD['io'] | |
StringIO = SD['StringIO'] | |
Image = SD['Image'] | |
else: | |
import io, StringIO |