MarsEdit/WordPress Image Uploading Issues
This morning I was spending a little time trying to get a few more images uploaded to my WordPress weblog - one for Coding and another for Cube Life. I had picked out some nice images from Xcode and the web, and the Xcode one uploaded as nice as can be. But then the trouble started.
Try as I might, I could not get this one image uploaded. It was about a 50kb JPEG image and I tried it several times. No good. So I tried a little more compression to bring it down to about 25kb, and still no good. So I tried PNG - both 50kb in size and 25kb in size. No good. So I decided to look at the XML-RPC logs of MarsEdit. No help there.
Finally, I logged onto HostMonster and saw that the smaller PNG image actually got uploaded and the thumbnail image was created. Hmmm... I know that the images are also stored in a plist for MarsEdit and an image directory, but when I went to add it manually, it looked a lot more complex than a simple edit session, and I was afraid of messing things up. So I tried a few more things, and then finally emailed everything to Daniel at Red Sweater Software.
I wanted to send him the image and the RPC log from MarsEdit so that he could see what was happening. Maybe there's something happening that I didn't see, or something in the way the file is being encoded. Don't know. Interestingly, on the test case, the image made it up to WordPress, so I think I'm going to try and edit the plist to see if I can force it into the system.
UPDATE: this was an interesting puzzle to crack, and in the end I don't know that I've cracked it as much as I know what works and what doesn't. So, here's what I found out:
- Use Photoshop's Save to Web for maximum compression - this may be extremely obvious, but I tried using GraphicConverter and it wasn't a lot of help, and I tried saving it to different formats, but in the end, it was Photoshop that told me what I needed to be saving it as, and it showed me side-by-side images to allow me to choose what to do. That's the important first step: get the image size down to as small as possible.
- Somehow, get the Image to WordPress - this was interesting because in some cases, the failed upload from MarsEdit did actually get the image up to WordPress. Sometimes it didn't. I had greater success with smaller GIF files than PNG or JPEG files that were a little bigger. I'm guessing you can upload images from the WordPress Dashboard, but I haven't figured that out, and MarsEdit was good enough.
- If you have to replace an image - delete and then add - this is most easily done by deleting the images in the MarsEdit directory, and removing the entry in the plist, and then going to WordPress' Dashboard and deleting the image there. Then add it back in. This way, you get the thumbnails made by both programs.
- When adding an image to MarsEdit omit the thumbnail - MarsEdit will create the thumbnail if you just place the image in the MarsEdit directory, create a new plist entry with the right values and omit the thumbnail image and plist entry.
With these tips, I was able to remove images from both locations, replace images, and in general, get around these uploading problems that I've been having. When I was exchanging emails with Daniel on this issue he was surprised about this behavior and wanted me to send him more files that I run across that have this same problem.