Code Duplication    Length = 13-15 lines in 2 locations

php/plugins/AutoResize/plugin.php 1 location

@@ 187-201 (lines=15) @@
184
		try {
185
			$img = new imagick($src);
186
			
187
			if (strtoupper($img->getImageFormat()) === 'JPEG') {
188
				$img->setImageCompression(imagick::COMPRESSION_JPEG);
189
				$img->setImageCompressionQuality($quality);
190
				if (!$preserveExif) {
191
					try {
192
						$orientation = $img->getImageOrientation();
193
					} catch (ImagickException $e) {
194
						$orientation = 0;
195
					}
196
					$img->stripImage();
197
					if ($orientation) {
198
						$img->setImageOrientation($orientation);
199
					}
200
				}
201
			}
202
			
203
			$img->resizeImage($width, $height, Imagick::FILTER_LANCZOS, true);
204
			

php/elFinderVolumeDriver.class.php 1 location

@@ 4251-4263 (lines=13) @@
4248
					$img->setImageFormat('jpeg');
4249
				}
4250
			}
4251
			if (strtoupper($img->getImageFormat()) === 'JPEG') {
4252
				$img->setImageCompression(imagick::COMPRESSION_JPEG);
4253
				$img->setImageCompressionQuality($jpgQuality);
4254
				try {
4255
					$orientation = $img->getImageOrientation();
4256
				} catch (ImagickException $e) {
4257
					$orientation = 0;
4258
				}
4259
				$img->stripImage();
4260
				if ($orientation) {
4261
					$img->setImageOrientation($orientation);
4262
				}
4263
			}
4264
			$result = $img->writeImage($filename);
4265
		} catch (Exception $e) {
4266
			$result = false;