getMTime()) <= $last2mis) { 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"); } if (strpos(strtoupper($file), '.HEIC') !== false) { $pdfcommand=' ; /usr/local/bin/convert -quality 100 "' . $pdfprefix . '*.{jpeG}" ' . $pdfprefix . '.Pdf'; } else { $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"); } if (strpos(strtoupper($file), '.HEIC') !== false) { $pdfcommand=' ; /usr/local/bin/convert -quality 100 "' . $pdfprefix . '*.{jpeG}" ' . $pdfprefix . '.Pdf'; } else { $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"); } if (strpos(strtoupper($file), '.HEIC') !== false) { $gifcommand=' ; /usr/local/bin/convert -delay 20 "' . $gifprefix . '*.{jpeG}" -loop 0 ' . $gifprefix . '.Gif'; } else { $gifcommand=' ; /usr/local/bin/convert -delay 20 "' . $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"); } if (strpos(strtoupper($file), '.HEIC') !== false) { $gifcommand=' ; /usr/local/bin/convert -delay 20 "' . $gifprefix . '*.{jpeG}" -loop 0 ' . $gifprefix . '.Gif'; } else { $gifcommand=' ; /usr/local/bin/convert -delay 20 "' . $gifprefix . '*.{jpeg}" -loop 0 ' . $gifprefix . '.Gif'; } } } if ((!file_exists(str_replace('.png','.jpg',$file)) && !file_exists(str_replace('.png','.jpeg',$file)) && strpos(strtoupper($file), '.HEIC') === false) || (!file_exists(str_replace('.heic','.jpG',str_replace('.HEIC','.jpG',$file))) && !file_exists(str_replace('.heic','.jpG',str_replace('.HEIC','.jpG',$file))) && strpos(strtoupper($file), '.HEIC') !== false)) { if (strpos($file, '.HEIC') !== false) { exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.HEIC','.jpeG',$file) . $pdfcommand . $gifcommand); } else if (strpos($file, '.heic') !== false) { exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.heic','.jpeG',$file) . $pdfcommand . $gifcommand); } else { //file_put_contents("xr.xr","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) . $pdfcommand . $gifcommand); } } else if ((!file_exists(str_replace('.png','.jpg',$file)) && file_exists(str_replace('.png','.jpeg',$file)) && strpos(strtoupper($file), '.HEIC') === false) || (!file_exists(str_replace('.heic','.jpG',str_replace('.HEIC','.jpG',$file))) && file_exists(str_replace('.heic','.jpG',str_replace('.HEIC','.jpG',$file))) && strpos(strtoupper($file), '.HEIC') !== false)) { if (strpos($file, '.HEIC') !== false) { exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.HEIC','.jpG',$file) . $pdfcommand . $gifcommand); } else if (strpos($file, '.heic') !== false) { exec("cd " . __DIR__ . '; /usr/local/bin/convert -quality 30 ' . $file . ' ' . str_replace('.heic','.jpG',$file) . $pdfcommand . $gifcommand); } else { //file_put_contents("xr.xr","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) . $pdfcommand . $gifcommand); } } } } } ?>