私は16コアのマシンを持っていますが、現在のサイズ変更機能は1つのコアしか使用していません。これは、画像の大きなディレクトリには非常に非効率的です。
def generateThumbnail(self, width, height):
"""
Generates thumbnails for an image
"""
im = Image.open(self._file)
(detected_width,detected_height) = im.size
#Get cropped box area
bbox = self.getCropArea(detected_width, detected_height, width, height)
#Crop to box area
cropped_image = im.crop(bbox)
#Resize to thumbnail
cropped_image.thumbnail((width, height), Image.ANTIALIAS)
#Save image
cropped_image.save(self._path + str(width) + 'x' +
str(height) + '-' + self._filename, "JPEG")
どんな助けでも大歓迎です。ありがとうございました。