Commit 2b444785 by Scott

Use jpg instead of jpeg

parent fa6fe203
...@@ -51,7 +51,7 @@ function qa_get_max_upload_size() ...@@ -51,7 +51,7 @@ function qa_get_max_upload_size()
* images, set $imagemaxwidth and $imagemaxheight. The function returns an array which may contain the following elements: * images, set $imagemaxwidth and $imagemaxheight. The function returns an array which may contain the following elements:
* *
* 'error' => a string containing an error, if one occurred * 'error' => a string containing an error, if one occurred
* 'format' => the format (file extension) of the blob created (all scaled images end up as 'jpeg') * 'format' => the format (file extension) of the blob created (all scaled images end up as 'jpg')
* 'width' => if an image, the width in pixels of the blob created (after possible scaling) * 'width' => if an image, the width in pixels of the blob created (after possible scaling)
* 'height' => if an image, the height in pixels of the blob created (after possible scaling) * 'height' => if an image, the height in pixels of the blob created (after possible scaling)
* 'blobid' => the blobid that was created (if there was no error) * 'blobid' => the blobid that was created (if there was no error)
...@@ -106,7 +106,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o ...@@ -106,7 +106,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o
$pathinfo = pathinfo($sourcefilename); $pathinfo = pathinfo($sourcefilename);
$format = strtolower(@$pathinfo['extension']); $format = strtolower(@$pathinfo['extension']);
$isimage = ($format == 'png') || ($format == 'gif') || ($format == 'jpeg') || ($format == 'jpg'); // allowed image extensions $isimage = in_array($format, array('png', 'gif', 'jpeg', 'jpg')); // allowed image extensions
if ($isimage) { if ($isimage) {
$imagesize = @getimagesize($localfilename); $imagesize = @getimagesize($localfilename);
...@@ -121,7 +121,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o ...@@ -121,7 +121,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o
break; break;
case IMAGETYPE_JPEG: case IMAGETYPE_JPEG:
$format = 'jpeg'; $format = 'jpg';
break; break;
case IMAGETYPE_PNG: case IMAGETYPE_PNG:
...@@ -165,7 +165,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o ...@@ -165,7 +165,7 @@ function qa_upload_file($localfilename, $sourcefilename, $maxfilesize = null, $o
if (is_resource($image)) { if (is_resource($image)) {
$content = qa_gd_image_jpeg($image); $content = qa_gd_image_jpeg($image);
$result['format'] = $format = 'jpeg'; $result['format'] = $format = 'jpg';
$result['width'] = $width; $result['width'] = $width;
$result['height'] = $height; $result['height'] = $height;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment