Quote:
Originally Posted by hobnail
|
The problem isn't knowing what is required. It is instead finding all the places where it matters. For example, it wasn't obvious that the common read method is sometimes used for images. As the referred-to document says
Quote:
(it is highly recommended you don’t design APIs that can take both due to the difficulty of keeping the code working; as stated earlier it is difficult to do well).
|
Other than rewriting the plugin not to use a common interface, something I am not willing to do, the fix is to check the file extension and use 'rb' if it is an image extension and 'r' otherwise.
EDIT: Sorry if I sound a bit snippy. I do appreciate the suggestions.