A duct tape fix that I found that may help others

Luminare

Joined: 2014-06-08
Posts: 4
Posted: Thu, 2014-06-26 21:35

So I've been having a huge issue for about a week or so where trying to delete an album would produce a "Unreadable File" error from the photo.php

Interestingly enough, after throwing this error, the next delete operation (on the same album) would work without issue. This was extremely frustrating since I had to manually go through and delete each subfolder individually.

The work around that I found was to actually code a bypass for the exception that was being thrown. I essentially returned an empty array back to the calling function. This worked like a charm.

The relevant code:

102  static function get_file_metadata($file_path) {
103    if (!is_readable($file_path)) {
104      return array(0,0,"image/jpeg",".jpg"); //Added by Luminare to bypass throw
105      throw new Exception("@todo UNREADABLE_FILE");
106    }

Hopefully this helps some one else!

Also I'd love if someone could check this and make sure I'm not mucking other things up :)