X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=api.php;h=2054350084a29108e54982d3de468354805b33da;hp=052b5145a47e5aef5701b72648896a3c08367369;hb=9d328be613bc25ef3f19f751bcf4de59343944c6;hpb=12376baf148afee289fbb53dd16ee2a0841d5290 diff --git a/api.php b/api.php index 052b514..2054350 100644 --- a/api.php +++ b/api.php @@ -100,17 +100,9 @@ function save_uploaded_file ($file, $con) { } $mini_dest = getthumbsdir () . "/mini_" . basename_safe ($dest); - try { - $thumbnail_ok = create_thumbnail ($dest, $mini_dest); - } catch (Exception $e) { - $thumbnail_ok = false; - } - if (!$thumbnail_ok) { - if (!copy ($dest, $mini_dest)) { - server_error (); - } + if (!create_thumbnail_or_copy ($dest, $mini_dest)) { + server_error (); } - } return basename_safe ($dest); }