You might find useful the following code to convert a whole directory of image in PNG format to JPEG:
(FileSystem disk workingDirectory filesMatching: '*.png') do: [ : pngFile | pngFile asFileReference binaryReadStreamDo: [ : stream | PluginBasedJPEGReadWriter putForm: (PNGReadWriter formFromStream: stream) onFileNamed: pngFile withoutExtension , 'jpg' ] ] displayingProgress: 'Converting images to JPG...'.
0 comentarios:
Publicar un comentario