X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=upload.php;h=1bca71a3d57b08c06b254ea05799f7c9d10b677e;hb=456602c35b5550a0ab8cbaf4c74ca6d00a3be076;hp=46f8b3cbd53e7386917bb6c7d697b4b750b1eeff;hpb=dabdfec87e89ad579cf543608ad118f30981a1c5;p=wfpl.git
diff --git a/upload.php b/upload.php
index 46f8b3c..1bca71a 100644
--- a/upload.php
+++ b/upload.php
@@ -2,21 +2,18 @@
# Copyright (C) 2007 Jason Woofenden
#
-# This file is part of wfpl.
-#
-# wfpl is free software; you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; either version 2.1 of the License, or (at your option)
-# any later version.
-#
-# wfpl is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
-# more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with wfpl; if not, write to the Free Software Foundation, Inc., 51
-# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
# This file contains functions to accept files being uplodad with the "124x58"
+function image_dimensions($image) {
+ $identify = path_to('identify');
+ $command = "$identify -format '%wx%h' " . escapeshellarg($image);
+ $dimensions = rtrim(`$command`);
+ if($dimensions == '') {
+ return false;
+ } else {
+ return $dimensions;
+ }
+}
+
# like save_uploaded_file() (above) except it converts gifs to pngs.
#
# FIXME: if a filename is passed in the end of path, we should check if the file type matches, and if not run convert.