Sunday, 21 December 2014

Adobe tricked me

Yesterday I was processing a pano. Then I spent quite a lot of time trying to write the description for it. There was a big building in the photo that I thought held a big float. So I spent some time researching, trying to find out what those big floats are called.

Then, after I had found the info and written it up, I found a blog post that contained an image of the park map where the pano was taken. This showed an image of a boat, not a float. So I then spent quite a while trying to figure out what it said.

The text was very small on the map photo. I could see in my pano the building had the same text on the edge of it. But in my photo the text was quite small, and some characters were partially or completely covered with leaves.

A further problem is that I'm rubbish at writing Chinese / Japanese characters, where the stroke order, direction, and number of strokes are all important for the MS IME to detect what character you're trying to write. But I did eventually manage to get a few of the characters correct, and with Google's help, managed to find the full name of the building.

When I'd finished writing the description, I went to add it to my photo, but the Adobe XMP FileInfo panel I use wasn't there, since I reinstalled Windows a week or so ago. I tried to find a backup of the panel file, but it seems I never made one.

I still had the source files for the panel, so it seemed I would need to compile it again. Looking at the Adobe website, it seems that CC 2014 uses a different method fr creating custom FileInfo panels to CC and CS6. But is Bridge CC or CC 2014? I tried installing one of the custom panels included with the CS6 XMP FileInfo SDK, but I could not get it to load.

Today I was continuing to try and solve this problem. It turned out that the issue was to with the location I was specifiying in the Flash Trust File. I had installed the panel to the already existing folder C:\Users\\AppData\Roaming\Adobe\XMP\Custom File Info\4.0\panels. But it seems that this is just a cheeky joke on Adobe's part by creating this folder. You actually have to install the panel to C:\Users\\AppData\Roaming\Adobe\XMP\Custom File Info Panels\4.0\panels.

Once I had figured this out and got the basic sample panel to load in Bridge's FileInfo, I tried to build my custom panel. But it wouldn't build. After a bit of working out what the problem was, I realised that the directory paths in the build.properties file need to use forward slashes as directory separators, not back slashes as windows uses. Quite confusing!

After solving that, the problem was now that it was Unable to locate tools.jar. It was looking for it in the jre directory, not jdk, so no wonder. The solution to this was to change the %JAVA_HOME% environment variable to explicitly point to the JDK directory. (Previously I just had it set to C:\Program Files\Java).

Well, hoo-ray my panel would build. But boo-ray, it wasn't showing up in Bridge. The answer - I needed a manifest.xml file for the panel. After doing this I could open the panel, but it would make Bridge freeze. I had to close the Bridge process from Task Manager to terminate it.

I tried building the basic sample panel to see if it was a problem with my panel. After correcting an error in the panel's code, which meant that the panel couldn't compile, I built the sample panel okay. But after adding it to the custom FileInfo panels folder, and opening Bridge, switching to the panel had the same effect - Bridge would crash and freeze.

I thought maybe this issue was the Flex project, now under Apache rather than Adobe, has had some changes made that make it incompatible with the old Adobe released Flex. So I downloaded the latest version of Flex from Adobe. After building the basic panel with that, I still got the same result.

So I tried using Flex 3 from Adobe (rather than Flex 4). And hey-ho, it worked! After some Googling, I came across this post from an Adobe employee, who does say that it needs the Flex 3 SDK to work, and won't work with Flex 4: Re: How to create a custom panel in the right way (without having an empty panel in the file info) ? A pity they couldn't be bothered to include that information in the XMP FileInfo panel SDK documentation.

With that done, all I had to do was copy over the XMP FileInfo settings (which I had backed up). Strangely these do go in a Custom File Info folder that had already been created, you don't have to create a new Custom File Info Panels folder for them. Maybe Adobe did this just to make it all as confusing as possible. Thankfully this was quite painless, and when I opened Bridge again, all my keywords were there (I also copied over the Bridge settings, which are separate to the XMP settings), and my custom FileInfo panel had all its data there too.

So, it's probably taken over a day's worth of work just to research the description and then be able to add it to my image.

Wednesday, 17 December 2014

Quoting something a spider makes (Websiting)

So, what have I been doing lately no-one is wondering. Well, no-one, I'll tell you:

On Sunday I wrote an article for my photo tips website.

On Monday I did some work on my pano website and made some Eccles Cakes.

On Tuesday I was mainly just working on my pano website.

Today (Wednesday) I was again working on my pano website. Quite a bit of time was spent just waiting for the various android SDK packages to download so I could test my site in the android emulator. I also made some Choux buns.

Friday, 12 December 2014

Sculping

Yesterday I was still working on the article for my photo tips website, recording some videos for it and inserting all the images, then proof-redaing it when it was finished.

I had some trouble recording the videos as at first my microphone seemed not to be working. Then I realised that actually no sound at all was working. I had to reinstall the drivers for my sound card. I'm not sure why they didn't work the first time. Possibly they did work then windows update installed some not working ones. Any way, at least it is working now.

This morning I prepared my pog website update and watched a couple of photography business related videos.

Most of the afternoon was spent checking my emails. I also updated the resizing embedded youtube videos javascript I worked on the other day. The issue was that I was firing it on the window's resize event, with no throttling. Now I've throttled it, so it will only run once every 250ms while window is resized.

In the evening I listed to Wilhelm Challenger and did some sculpey with Billy. (Well Billy actually did painting). I was working on a frog that I'll do for HAH. Making the colours took quite a long time. Then I needed to make the model. And after that I had to make another one and take photos of the process for the instruction leaflet.

Wednesday, 10 December 2014

Not Blogging

I think I ought to start blogging more often again. I often wonder where my time has disappeared to, and if I record what I've been doing in my blog, then at least I'll know.

Monday this week I was fixing some website stuff.

Yesterday (Tuesday) in the morning I went down town to post an ebay item (my old broken sandisk ssd) and try to get a christmas present for Mauser. In the afternoon and evening I prepared Mauser's present package, researched the postage costs, purchased and filled out all the related postage stuff, and started work on an article for my photo tips website.

The vast majority of today I was working on the article I started yesterday. In the morning I went out to try and get some photos to work on for it. I had to install Photoshop Elements trial, which took ages to download and then quite a long time to install.

In the afternoon I also made some Japanese Scotch Eggs. But I cooked the egg a bit too much so the yolk wasn't gooey, and I didn't actually like the flavour of the meat much either.

In the evening I watched an episode of Power Rangers with Billy and played a few online Mario Kart races. Then the rest of the evening was spent working on my article. I'll have to try and finish it off tomorrow.

Monday, 8 December 2014

Fixing setAttribute(...) is undefined error when setAttribute actually is defined

I was fixing up some website issues today. One of the problems was with a page that contained a youtube video. Because Youtube uses static sizing on their embed codes, the video was breaking out of the page on small screen sizes. I found a solution to this issue here: Fluid Width Video.

The site this was for uses plain js rather than jQuery, so I re-wrote the solution given in the CSS Tricks article. However, when I ran it, I recieved the following error:

TypeError: vid.setAttribute(...) is undefined

Yet I could go into the console and run vid.setAttribute (with the script paused where the error occured) with no problem. After much head scratching I finally decided to try the page in Chrome, rather than FireFox, which is what I was using. And I now saw what the real problem was - Chrome did not report that .setAttribute was undefined, but rather that .removeAttribute was not defined, which was the line below. Firefox (Firebug) was confusingly throwing the error a line early.

I was trying to use chaining, but setAttribute does not return the element you are calling it from. So you can't use chaining with it. The lesson - if the debug info in one browser doesn't make sense, try another.

Saturday, 22 November 2014

Writing and moving words

The past week I've mainly been putting the church magazine together and working on a couple of articles for my photo tips website. This morning I made some Gingerbread Latte syrup. I had some in a Coffee with plenty of milk, but it didn't seem very tasty. Maybe you need 1½ teaspoons to taste it better.

Monday, 3 November 2014

Giving up on Vagrant

Well, I probably haven't got everything working with my Vagrant box yet, but I can at least access a local copy of my website through it.

The first issue I had today was that Nginx wasn't starting with the machine, and my @reboot cron job wasn't being run either. I found the reason and a solution here: If Nginx doesn’t restart on Vagrant up. The problem is because vagrant (virtualBox) only mounts the shared folders after init and cron have run. So, in my case, the nginx conf files were in my shared folder, and the script I wanted to run @reboot was too. The solution is to add an init conf file to /etc/init that will start nginx / run the script when the vagrant shared folders are mounted.

Another issue I had was that although I had imported my mysql database, the users / privileges didn't seem to have carried over. I found the solution to this here: How can I export the privileges from MySQL and then import to a new server?. Strangely there were quite a few privileges for tables that no longer existed, so I had to delete those to get the import to import everything successfully.

So far, there are three points that seriously hamper the usability of Vagrant for me. Actually, these aren't really related to Vagrant, but problems using shared folders with VirtualBox when running a linux guest OS on a Windows host OS:

  1. Permissions can't be set properly. You can set permissions for a whole folder through the mount_options when mounting a shared folder, but this applies to the whole folder contents, and is a bit of a kludge.
  2. You can't create symbolic links in the shared folder. If you do it from Windows, then the VM can't read the link.
  3. Shared folders aren't mounted early enough, causing issues with init scripts and @reboot cron jobs.

Despite these problems, I intend to persevere, at least for the moment. The issue with using a standard VM without shared folders is that even if you only change 1 byte of code in a single file, then you have the whole VM to backup. I guess you could always just backup the files from the VM, but that means having to start up the VM and use FTP whenever you want to backup.

Aggh! I just found another issue with the shared folders - it seems that the VM has the same restrictions as windows when working with long filepaths in the shared folders! There is a possible solution given here: VirtualBox bug tracker: long paths (>260chars) cannot be created using a host:win + guest:linux setup.

However, I couldn't get that to work in combination with Vagrant. I tried specifying the path in the VagrantFile, but that gave an error about //?/E not being valid when trying to vagrant up. (I was using an absolute path to a folder on my E: drive). I tried running the command, which added the folder, but VirtualBox would not auto mount it. And you couldn't set the Auto Mount option for it using the VirtualBox GUI (the OK button was greyed out).

I also tried setting that up, then using a standard path in my VagrantFile, but the path in the VagrantFile overwrote the path set up using VBoxManage.exe. Thus the \\?\ at the start of the path was lost.

So it seems to me that with all these issues, Vagrant using VirtualBox with Shared folders on a windows host OS is just not usable at the moment. I'm going to go back to my VMWare Ubuntu VM for now. It took me over a week to try and set up this VM, only to have to abandon it. But I did learn some things along the way. Most of them I'll probably forget, but hopefully I can take a look at replacing my current shared hosting account with a VPS at some point.