<s> from wand . image import Image <EOL> import os <EOL> import re <EOL> MANIFEST = ( <EOL> ( '<STR_LIT:h>' , <NUM_LIT> ) , <EOL> ( '<STR_LIT:m>' , <NUM_LIT> ) , <EOL> ( '<STR_LIT:l>' , <NUM_LIT> ) <EOL> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> files = os . listdir ( "<STR_LIT>" ) <EOL> files = filter ( lambda x : re . match ( r"<STR_LIT>" , x ) is not None , <EOL> files ) <EOL> for filename in files : <EOL> with Image ( filename = "<STR_LIT>" % filename ) as img : <EOL> print ( "<STR_LIT>" % filename ) <EOL> width , height = img . size <EOL> for dpi , ratio in MANIFEST : <EOL> cimg = img . clone ( ) <EOL> cimg . resize ( int ( width * ratio ) , int ( height * ratio ) ) <EOL> cimg . save ( filename = "<STR_LIT>" % ( dpi , filename ) ) </s>
