Wednesday 18 September 2013

WordPresSing

Today I was doing more wordpress stuff. I looked at how to get the itemprop="name" added to the title of the page (using a plugin so it will work with any theme). This was actually quite difficult, as the only thing you can do to modify it is to add a filter to the_title(), or otherwise read the page into the output buffer and then use a regex or dom manipulations to locate the title and modify it. the_title() may be called various times in a page, not always relating to the current page's title, and sometimes as an attribute value rather than a text node.

When I'd got something reasonable set up, I then found that wordpress does some extra processing on the title that is passed into the filter compared the post_title of the $post object. Eventually I managed to figure out something that seems to work reasonably okay with the themes I have installed.

After that I worked on developing the minimal code social sharing buttons covered in this article: How to Add Fat-Free Social Buttons to Your Pages into a Wordpress plugin. I was actually hoping that someone else would do it, but it seems that no-one else has yet, so I thought I should get on with it.

When I was processing my panos on Monday I noticed that one of the cube faces (once prepared for web) has some strange banding. The banding was more similar to the banding you sometimes get in RAW files than what is typically referred to as JPEG banding. However, when I opened the image in Photoshop, the strange banding was nowhere to be seen. The banding was only visible in Windows Photo Viewer.

Here are a couple of pics that show the same area of the image in both Windows Photo Viewer and Photoshop. In one version I've increased the contrast greatly to make the banding really obvious.

It's annoying that Windows Photo Viewer shows the image like this. Still, it is a fast way to view images, and this sort of problem isn't very common. At least now I know about the issue I can always just open an image in PS to check it if it appears problematic.

No comments: