X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=api.php;h=2054350084a29108e54982d3de468354805b33da;hp=052b5145a47e5aef5701b72648896a3c08367369;hb=259b6d11bb6d0233343744c0452358293d5be517;hpb=080f837e8fbca48c55f4549df13b9c4772db3613 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); }