images used in posts are shown with size 1×1
-
I am new to WP and this is a brand new installation. I first tried with version 3.8.1 and had problems when trying to include images in posts or elsewhere like a featured image on a page. Examining the page source revealed that the correct image link was present, but that the width and height were each set to 1, so the image was there, but it was a single pixel dot.
Searching the forums revealed many reports of similar problems with 3.8.1, but not solutions, so I decided to revert to 3.8. After removing the wordpress directory and database from my site, I started over and did a fresh install of version 3.8. Without doing anything else, I tried creating a post and inserting an image into it. At this point, I experienced a new problem in that when I tried to upload an image, I got an error message telling me that it had failed and to try again later. I tried four times with the same result. I then switched to the media directory and saw that all four images were in-fact there and appeared to be OK.
Just to be safe though, I deleted all four of those, then did a fresh upload of the same image from the media library page. This time it worked with no error message, so I went back to the Posts page and tried to add the image to my post. It had the same problem as I was experiencing in 3.8.1.
You can see an example here: https://birchtreebooks.com/
This WP site is version 3.8 and is hosted on a 1and1.com shared server and the version of PHP I’m using is 5.4.Look at the second post. There is supposed to be an image at the end of the line and if you look really close, you’ll see a single pixel dot. Using the URL to the image from the page source will show that the image is present and displayable.
I also noticed that when in the media library page, if I clicked on “View” for the uploaded image, I got the following error message:
“Warning: Illegal string offset ‘width’ in /homepages/10/d160957291/htdocs/arttouch_wp/wp-content/themes/twentyfourteen/image.php on line 31”
I got an identical message about ‘height’.
Examining the code referenced in this message showed that it was supposed to fill in the correct width and height value with $metadata[‘width’] and the same for height. It is apparently not getting valid values for these entries. I believe that is probably the same thing that is causing the problem with images in posts.
In previous experiments, I used the text mode of the Post editor to change the width and height dimensions for the image, and also to just remove those settings and in both cases, it allowed the image to be displayed, but obviously that is not a solution.
- The topic ‘images used in posts are shown with size 1×1’ is closed to new replies.