X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=upload.php;h=8beca1c0976571f7557a49171ae21b33a69a6aba;hp=f52f0cfe3887ce89cc3a2f294567b96e0c976bde;hb=eecd5e3576866afc8091abe9b74352130fd8e6cc;hpb=423f31ad0add74bbb6066d3c9f760ad0a5580cda diff --git a/upload.php b/upload.php index f52f0cf..8beca1c 100644 --- a/upload.php +++ b/upload.php @@ -34,9 +34,9 @@ # Example: # #
-# -# -# +# +# +# #
# # ####### @@ -152,7 +152,7 @@ function generate_filename($path, $mime = 'text/plain') { # the client's name appended. Otherwise $path will be used as the filename # exactly as is, even if extensions differ between the client's name and $path. # -# where user uploads "c:\foo\Bar baz.PDF" at +# where user uploads "c:\foo\Bar baz.PDF" at # save_uploaded_file('in', 'uploaded_pdfs/'); yeilds: # "uploaded_pdfs/bar_baz.pdf" # save_uploaded_file('in', 'uploaded_pdfs/prefix.'); yeilds: @@ -224,7 +224,7 @@ function gif_to_png($filename, $new_filename = 'just change extension') { $new_filename .= '.png'; } - imagemagick_convert($filename, $new_filename, "$convert -colorspace RGB", 'GIF to PNG conversion'); + imagemagick_convert($filename, $new_filename, "-colorspace sRGB", 'GIF to PNG conversion'); unlink($filename); return $new_filename; @@ -331,7 +331,7 @@ function image_w_h_or_die($filename) { # Like save_uploaded_file() (above) except that it converts all images to PNG -# or JPEG, converts to RGB colorspace, and optionally scales and/or creates a +# or JPEG, converts to sRGB colorspace, and optionally scales and/or creates a # thumbnail. And, if $path ends with a period, the correct extension will be # appended. # @@ -392,7 +392,7 @@ function convert_uploaded_image($key, $path, $image_width = 0, $image_height = 0 $filename = $path; } - $convert_params = '-colorspace RGB'; + $convert_params = '-colorspace sRGB -auto-orient'; if($image_width > 0 && $image_height > 0) { $convert_params .= " -geometry ${image_width}x$image_height"; }