Thursday, January 1, 2015

Photoshop > Import Video to Layers on Windows 8.1

TL;DR - Install QuickTime 7.1.6, then update to 7.7.6

Having just migrated my Adobe Creative Suite 3 setup to a new laptop, I tried to extract frames from a video. At first it complained about "Could not complete the Video Frames to Layers command because the QuickTime version 7.1 or later is required." so I didn't think much of it.

And then I grabbed the latest installer off of https://www.apple.com/sg/quicktime/download/ easily enough. It's 2015 and any incompatibilities would have been resolved since Windows 8.1 came out... right? Wrong. Photoshop failed to detect my newly installed QuickTime 7.7.6. I tried "activating" it by launching the player manually, run with compatibility mode, reinstall with compatibility mode and even Run As Administrator.

Then I found this guy that had a similar situation. He mentioned that he stuck to QuickTime 7.1 and it works for him. I double-checked with my old laptop, but the version was 7.7.6 there. Regardless, I dug into the QuickTime download pages for older versions and found it. The installer worked and Photoshop was happy. But while it detected the older version, I wanted to match the version on my old laptop, so at the risk of breaking the setup, I updated QuickTime. It detected the new 7.7.6 and had me restart my machine.

I came back to Photoshop, lo and behold, it still worked. Now Photoshop can do what I want it to do, and I can rest easy knowing my version of QuickTime is up-to-date.

Happy New Year!

Tuesday, December 30, 2014

<SELECT> with <OPTGROUP> doesn't have .remove() implemented [IE9+]

I found this semi-official link (because it's part of Microsoft.com, but a forum of sorts)

TL;DR - my way
var opts = selectControl.options;//I was doing other stuff with the options
opts[deleteIndex].parentElement.removeChild(opts[deleteIndex]);
 
The above was modified based on what was contributed by Abhisek Gupta:
selectControl.options[deleteIndex].parentElement.removeChild(selectControl.options[deleteIndex]); 
The explanation was something about .remove() not being in ECMAScript to begin with...

The root of the solution is to use .removeChild() but this one-liner is slightly more elegant:
  1. retrieve the HTMLOptionElement from its HTMLSelectElement;
  2. call its parent; in other words, our offending HTMLOptGroupElement;
  3. instruct for it to removeChild;
  4. pass in part 1. as argument to part 3.
You can alternatively check this other link.

Additionally, I wanted to detect for the presence of HTMLOptGroupElement. I added this to check:
function hasOptGroups(selObj) {
    if(selObj instanceof HTMLSelectElement) {
        var selCN = selObj.childNodes;
        if(selCN && selCN.length > 0) {
            for(var x=0;x<selCN.length;x++) {
                if(selCN[x] instanceof HTMLOptGroupElement) {
                    return true;
                    break;
                }
            }
        }
    }
    return false;
}



This way, I still get to use the original .remove() if there are no <OPTGROUP>'s present.

Monday, December 22, 2014

External Maxtor hard disk failed

I have a Maxtor OneTouch 1TB connected to my router as a NAS. So while trying to access it earlier, it couldn't be connected to successfully. The router browser UI showed the drive mounted but didn't show any read/write permissions like it used to.

I connected its USB to my laptop directly. Windows Explorer was able to display the drive (F: in my case here) but complained of the drive "File or directory is corrupted  or unreadable". My heart sank. Until I found this lifesaver. Most of the suggestions linked to shady blogs which I felt reluctant to try. Until I scrolled down to the solution suggested by kwagalamoshe.

Hello,

Try this 1

Click on Start --> Run --> Type cmd and press Enter.

"Command Prompt" will be opened.

Since you are having problem with G & H drivers, enter the below command

chkdsk /f g: --> Press Enter.

chkdsk /f h: --> Press Enter.

Good Luck 

It seemed straightforward enough, and it was utilising a system tool. No harm trying, so I decided to give it a shot. And it totally worked! CHKDSK was able to recover the filesystem with a couple of fixes to repair whatever was damaged.

I'm glad I found this solution but was surprised at the lack of information anywhere else. If you ever encounter anything similar, give CHKDSK a shot first (assuming you can still see the drive in Windows Explorer, hopefully). Good luck!