5,7d4 < $pdfprefix=""; < $pdfcommand=""; < $gifcommand=""; 12,41d8 < if (strpos($file, '_to_pdf') !== false || strpos($file, '_via_pdf') !== false) { < if (strpos($file, '_to_pdf') !== false) { < $pdfprefix=explode('_to_pdf', $file)[0]; < if (file_exists($pdfprefix . ".Pdf")) { < unlink($pdfprefix . ".Pdf"); < } < $pdfcommand=' ; /usr/local/bin/convert -quality 100 "' . $pdfprefix . '*.{jpeg}" ' . $pdfprefix . '.Pdf'; < } else if (strpos($file, '_via_pdf') !== false) { < $pdfprefix=explode('_via_pdf', $file)[0]; < if (file_exists($pdfprefix . ".Pdf")) { < unlink($pdfprefix . ".Pdf"); < } < $pdfcommand=' ; /usr/local/bin/convert -quality 100 "' . $pdfprefix . '*.{jpeg}" ' . $pdfprefix . '.Pdf'; < } < } < if (strpos($file, '_to_gif') !== false || strpos($file, '_via_gif') !== false) { < if (strpos($file, '_to_gif') !== false) { < $gifprefix=explode('_to_gif', $file)[0]; < if (file_exists($gifprefix . ".Gif")) { < unlink($gifprefix . ".Gif"); < } < $gifcommand=' ; /usr/local/bin/convert -delay 400 "' . $gifprefix . '*.{jpeg}" -loop 0 ' . $gifprefix . '.Gif'; < } else if (strpos($file, '_via_gif') !== false) { < $gifprefix=explode('_via_gif', $file)[0]; < if (file_exists($gifprefix . ".Gif")) { < unlink($gifprefix . ".Gif"); < } < $gifcommand=' ; /usr/local/bin/convert -delay 400 "' . $gifprefix . '*.{jpeg}" -loop 0 ' . $gifprefix . '.Gif'; < } < } 43c10 < exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.png','.jpeg',$file) . $pdfcommand . $gifcommand); --- > exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.png','.jpeg',$file)); 45c12 < exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.png','.jpg',$file) . $pdfcommand . $gifcommand); --- > exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.png','.jpg',$file));