def process(self, current_path, original_path, options): command = MagickCommand(False).append('convert', current_path) width = str(self.settings['width']) height = str(self.settings['height']) if self.settings['unit'] == '%': geometry = width + '%x' + height + '%' else: geometry = width + 'x' + height if not self.settings['keep_ratio']: geometry = geometry + '!' command.append('-liquid-rescale', geometry) return command.run()
def process(self, current_path, original_path, options): command = MagickCommand().append('convert', current_path) command.append('-background') command.append_color(self.settings['background_color']) degrees = str(self.settings['angle']) if self.settings['condition'] == 1: degrees = degrees + '>' elif self.settings['condition'] == 2: degrees = degrees + '<' command.append('-rotate') command.append(degrees) return command.run()
def process(self, current_path, original_path, options): command = MagickCommand().append('convert', current_path) black_point = str(self.settings['black_point']) white_point = str(self.settings['white_point']) gamma = str(self.settings['gamma']) command.append('-level') if command.gm: command.append(black_point + ',' + gamma + ',' + white_point + '%') else: command.append(black_point + ',' + white_point + '%,' + gamma) return command.run()
def process(self, current_path, original_path, options): command = MagickCommand().append("convert") width = str(self.settings["width"]) height = str(self.settings["height"]) if self.settings["unit"] == "%": geometry = width + "%x" + height + "%" else: size = width + "x" + height command.append("-size") command.append(size) geometry = size command.append(current_path) if not self.settings["keep_ratio"]: geometry = geometry + "!" if self.settings["fastest_method"]: command.append("-scale") else: command.append("-resize") command.append(geometry) if self.settings["filter"] != "Auto": command.append("-filter") command.append(self.settings["filter"]) return command.run()