View Single Post
Old 09-26-2020, 01:53 PM   #1426
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by hobnail View Post
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.

Last edited by chaley; 09-26-2020 at 01:56 PM.
chaley is offline   Reply With Quote