WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#2402 closed enhancement (wontfix)

[PATCH] upload image fix

Reported by: gregmac Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0
Component: Administration Keywords: upload
Focuses: Cc:

Description

I have two sites with safe mode on where images were not able to be uploaded, giving the following errors:

Warning: imagejpeg(): Unable to access /..../wp-content/test.thumbnail.jpg in /..../wp-admin/admin-functions.php on line 761

Warning: imagejpeg(): Invalid filename '/..../wp-content/test.thumbnail.jpg' in /..../wp-admin/admin-functions.php on line 761

Warning: Cannot modify header information - headers already sent by (output started at /..../wp-admin/admin-functions.php:761) in /..../wp-admin/inline-uploading.php on line 101

I was unable to determine the percise cause of this, but creating the thumbnail image before writing to it seemed to work (therefore this is likely a bug upstream in GD or PHP somewhere). The following patch is a workaround:

--- wp-admin/admin-functions.php.orig        2006-01-30 17:03:06.000000000 -0500
+++ wp-admin/admin-functions.php       2006-02-01 00:05:17.000000000 -0500
@@ -750,6 +750,7 @@
                                $thumb = preg_replace('!(\.[^.]+)?$!', __('.thumbnail').'$1', basename($file), 1);

                        $thumbpath = str_replace(basename($file), $thumb, $file);
+                       touch($thumbpath);

                        // move the thumbnail to it's final destination
                        if ($type[2] == 1) {

Change History (1)

comment:1 @Nazgul9 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

No action in over a year and questionable validity due to the recent upload changes.

Note: See TracTickets for help on using tickets.