Saturday 27 June 2009

Websiting

This morning I went on Animal Crossing, then watched an episode of 星のカービィ with L. After that I checked my email and also tried to find a question I posted on the jQuery Google groups ages ago to see if it had had any replies. Weirdly, searching the jQuery Google groups and also going on my posting history on google groups didn't come up with anything. But doing a normal google search did come up with the thread, and I hadn't got any replies.

I did some more work on my photo website, to try and get it so I could upload Desktop sized images along with my main full size image. I wanted to make sure that all metadata, embedded thumbnails and colour profiles etc. that might weight a Desktop sized image down, but shouldn't be needed, were stripped. Doing some googling, I found that ImageMagick has a command to do this, -strip, and the Imagick PHP extension has the same function available as Imagick::stripImage.

I wanted to make sure that stripping the metadata with ImageMagick wouldn't be lossy though, but googling about this, it seems it is a lossy operation - the article on the ImageMagick website about Digital Photo Orientation says
JPEG Format is Lossy



What this means is that any time you decode and save the JPEG file format you
will degrade the image slightly. As a general image processor, IM will always
completely decode and re-encode the format, as such it will always degrade
JPEG images when it re-saves the image.


Anyway, no problem as exiftool can do the job. I thought that using a PHP extension like Imagick would be faster than executing a shell command though, which is why I was hoping Imagick could do it.

During the afternoon and I did more work on my website, and I also checked Andy Rouse's blog and The Luminous Landscape.

In the evening I did some more website work, then went in the garden about 8.30pm - 9.45pm and took some photos. There wasn't much about to take photos of really, I mainly took more flea beetle photos, even though I've already got about a million. Still, at least the flea beetles now are a slightly different colour to the photos I took before. They're more browny now, when before they were orangey. There was lots of leaf hoppers around as well, but they were constantly hopping, so no hope for a photo.

After that I processed the RAWs into jpegs, then did some more website stuff.

I had some problem with javascript, when I assigned a value to a variable and then checked a property of that variable in the same if statement, I got an error that the variable was undefined.
Here's an example, which is designed to loop through my category elements:
for(var i=1, el; el=$('#category'+i) && el.length; i++)
{
alert(i);
}

Googling for the error that Firefox gives when you make an assignment inside an if statement Warning: test for equality (==) mistyped as assignment (=)?, I found this helpful page, which describes how to solve the problem: Warning: test for equality (==) mistyped as assignment (=)? All you need to do is add some brackets around the assignment, and then it works fine, like so:
for(var i=1, el; (el=$('#category'+i)) && el.length; i++)
{
alert(i);
}

I thought that javascript always evaluated the left side of an if statement first, but maybe it doesn't, and so you have to put brackets around the part of the statement you want evaluated first?

Food
Breakfast: Strawberry jam toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese with crunchy salad sandwich made with fresh bread-maker-made bread; clementine; Trophy; cup o' tea.
Dinner: Mariner's pie; grated mature cheddar cheese; peas; ground black pepper; Crust of bread-maker-made bread with I cannae be-cheese it's nae butter jock; slice of bread-maker-made bread with grated mature cheddar cheese. Pudding was a raspberry ripple mousse.

No comments: