Wednesday 17 March 2010

Blah blah blah

This morning I checked my emails and went through my Pogs to see what swaps I wanted and could swap with someone.

That took quite a while. When I was done I followed the advice given to me about my PHP batch image processing script timing out. After making the changes they suggested to the script, I ran it again on my Ubuntu Virtual Machine with the same batch of images that failed yesterday, and it worked okay. I then uploaded the script to the web server, and ran it on there.

It worked okay on the web server, but in the output of the script, the filenames of files with Hangeul in them were all messed up, e.g. 458-Palgak-jeong-í��ê°�ì�.jpg
So I checked the filenames on the webserver, and it looked like they were saved with the correct filename okay.

When checking the file, I noticed that it didn't have a color profile recorded in the database. So I looked into this and found that Capture NX 2 saves images with a slightly different colour profile (Nikon Adobe RGB 4.0.0.3001) compared to Capture NX 1.3 (Nikon Adobe RGB 4.0.0.3000). Since I didn't have an entry in the database for the Nikon Adobe RGB 4.0.0.3001 profile, this meant all images I'd processed with Capture NX 2 had been recorded in the database with no colour profile information.

So I added an entry to the database for Nikon Adobe RGB 4.0.0.3001, then updated the records that should have had Nikon Adobe RGB 4.0.0.3001 recorded as being their colour profile.

I checked The Luminous Landscape and my emails, then it was lunch.

After lunch I tried uploading a single image to my photo website using the web form, I couldn't upload it as part of the batch because it had the same filename as another file that was part of the batch. However, the upload didn't work properly, and the image wasn't moved and resized.

At first I found a simple mistake in my code where I was trying to get the file extension based on the name of the actual image file instead of the uploaded image file. In my batch upload script this didn't make difference as both were the same, but for the single image web form upload, the actual filename is something like /tmp/phpdwy8qy9wd.

But after fixing that, the script still wasn't working. I found the problem was that when I used the PHP function escapeshellcmd() on the image filename, it was stripping out the Hangeul, and so passing ImageMagick a non-existent filename.

I found this has been reported as a bug with PHP. I tried the solution suggested there:
Try using:
setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8");
And that worked.

What I don't understand though, is how come the same problem didn't occur when I ran the batch image processing script?

I checked my email again, then synced my local copy of my photo website and database to match the one on the web server. My Ubuntu Virtual Machine said it was running out of disk space so I expanded its hard drive. The rest of the afternoon and a bit of the evening I carried on processing the Farmers' dance photos I was working on yesterday.

After dinner I watched Lost with Mauser and L, which had Widmore in it! You did! How should I know? Know I should how?

In the evening I also posted some Pog swaps. It took quite a while to get the postage printed as the royal mail website kept saying there was an error when I submitted the payment, and to try again later. I did try a couple more times after a few minutes, but still got the same error. There wasn't any message on the website that the online postage service was down or anything though.

So I tried entering my credit card details anew (since before I was using the credit card details the Post Office had saved for me), and then it worked okay. If the problem before was that the payment couldn't be accepted because I was using old invalid card details, then it's weird how they didn't just say this, but instead said to try again later.

I installed a tab bar for windows explorer as well.

The weather this morning was overcast, then the sun came out for about an hour, then it clouded over again. There was quite a good sunset.

Food
Breakfast: Bowl of Maple & Pecan Crunch Oat Cereal; Cup o' Tea.
Lunch: Peppered Ham with Dijon Mustard and Salad Sandwich; Banana; Scone with I can believe it's not butter and Strawberry Jam; Home-made Chocolate Caramel centred Muffin; Cup o' Tea.
Dinner: Slice of Barbecue Chicken Pizza; Slice of Pepperoni Pizza; Mashed Potato; Green Beans. Pudding was Home-made Fruit Salad with 2 slice of Jam Swiss Roll and Custard. Coffee.

No comments: