#2199 closed defect (bug) (fixed)
Image Upload uses wrong size when sending to editor
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0 |
Component: | Administration | Keywords: | bg|has-patch |
Focuses: | Cc: |
Description
Sending an image to the editor with "Using Original" adds width and height attributes using the size of the thumbnail instead of the original image. It does insert the right SRC attribute (i.e. it points to image.jpg and not image.thumbnail.jpg), and removing the width and height attributes allows you to show the image at the original size, but if you're going to insert metadata, it should be the right metadata.
Observed using WordPress 2.0 with the plain-text editor and Firefox 1.5.
Attachments (1)
Change History (8)
#2
@
17 years ago
- Keywords bg|has-patch added; image upload size removed
- Milestone set to 2.1
- Owner changed from anonymous to ryan
innerHTML wasn't responding to changes in src attribute.
This patch removes height and width attributes during Send To Editor function, and fixes image to be sent with the proper src attribute.
#5
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
I just installed the latestest update 3407 and im getting these.
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/ec1/blog/htdocs/wp-admin/inline-uploading.php:2) in /usr/home/ec1/blog/htdocs/wp-admin/inline-uploading.php on line 139
As discussed at http://wordpress.org/support/topic/53640:
The code on lines 81-85 in wp-admin/inline-uploading.php appears to determine the size of the thumbnail file that WP generates:
But from what I can tell, this code does not actually affect the dimension attributes WP uses when inserting the image. For example, changing the code in inline-uploading.php will result in a thumbnail file with larger dimensions on your server, say 256x192, but when browsing and inserting the thumbnail into the post, WP will still apply the code using something like
<img src="pic.jpg" width="128" height="96 />
. This is where admin-functions.php comes into play.Lines 1771-1778 look something like this:
and lines 1863-1870 look something like this:
Now I've tinkered around with it for a while, replacing the 128 and 96 values with larger integers. I have had limited success in which inserted images now appear with their original dimensions; however, when opting to insert thumbnails, the "thumbnails" are also stretched to the larger dimensions of the original, which causes them to be massively pixelated.
I am by no means up to snuff on PHP and coding in general, so I have a feeling that if someone more knowledgable were to take a look at the source in these files, there is a way to alter the dimension integers appropriately so that original images and thumbnails are displayed with their correct dimensions respectively.