Image Upload Size Test

June 11th, 2013

Invalid Server Response – The response to the metaWeblog.newMediaObject method received from the blog server was invalid.

The WLW log file found at “%LOCALAPPDATA%\Windows Live Writer” shows a line that explains the above error in more detail:

<br /> 
<b>Fatal error</b>:  Out of memory (allocated 26476544) (tried to allocate 4096 bytes) in <b>/homepages/20/d195061676/htdocs/daveblog/wp-includes/media.php</b> on line <b>937</b><br />

What is happening on the server is fairly simple; memory cannot be allocated in the PHP script. Unfortunately, the Windows Live Writer (WLW) program does not expect a PHP interpreter error like the one shown above; it only looks for responses that are generated by the script itself. Whoever wrote the media.php script should have caught this error and returned something that WLW could handle better.

After some research, I discovered that my host, 1and1, has some sort of hard limit on memory usage. Well, they did at one time or another. Adding a php.ini file in the wp-includes directory of my WordPress site worked although it took me more than one try to get it right. I’m not sure what I did wrong the first time I tried this but here is exactly what I have in the php.ini file now:


I also made some changes to the options in WLW because I suspect that there is a limit imposed by 1and1 that is below what I want.


Link Options

After clicking on an image in a WLW window, click on the Format tab then clicked on Link Options. The box shown above appears although it is not called “Link Options”. Click on the small ruler/triangle icon button next to the size selection box and changed the default size for large images (See image below).I wanted to use a size that would fill a large monitor but since larger sizes cause the PHP script on the server to use more memory, I settled on 1600×1200. These are maximum sizes, not absolute sizes.


Default Picture Sizes

The final step is to pick the large image in the Size selection box in the Link Options (AKA Source Picture Options) whenever an image is pasted into a blog post or page.

Below is an image that is larger than 1600×1200. The upload works and clicking on this image in a browser should open a thickbox (specially formatted popup for displaying images) view that is almost as big as the browser window on most computer screens. Below that is the same image adjusted so that the final size is exactly 1600×1200. I was able to publish this post without incident. If I use a larger image size for the Source Picture Options then the upload will fail with a memory error.



Large Image Test


1600×1200 Image Test

Leave a Reply

You must be logged in to post a comment.