- cmd = ["convert", file, output_name]
- debug("""Convert command: '"%s"'""" % '" "'.join(cmd), DEBUG_LEVEL_DEBUG)
- return output_name, subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stderr, stdin=None).wait()
+ try:
+ import PIL, PIL.Image
+ img = PIL.Image.open(file)
+ img.save(output_name, "PNG")
+ return output_name, True
+ except ImportError:
+ debug('Could not load PIL, going to try just copying the image')
+ import shutil
+ output_name = os.path.join(self._ConvertedWallpaperLocation, os.path.basename(file))
+ shutil.copyfile(file, output_name)
+ return output_name, True