-
Notifications
You must be signed in to change notification settings - Fork 14
Decoder works great when used in isolation. Does not play with other decoders (such as the image/png/jpg built-ins)? #3
Comments
The problems lays in the TGA format itself. |
Cheers, good to know! Will give the "import-first" approach a go... in due course ;D |
FWIW, there is a fork that removes the automatic registration of TGA, replacing with a |
FWIW, decoder tests do not pass for me with Go 1.5 on OSX. I suppose the assumptions about the package registration order may have been broken during the compiler refactoring. Registering it as a default fallback sounds brittle to me. If TGA format does not lend itself to sniffing, then you should probably not try to do it. What about integrating @dblezek changes or something similar? |
That makes sense to me. |
@blezek thanks for that fork, solved my problem |
The TGA decoding itself works flawlessly, awesome work.
Now, my issue... it's really quite strange!
So first off, with this use-case A it works great: I have one Go program where both image/png and ftrvxmtrx/tga are imported directly (not "anonymously" via _ underscore). It just converts TGAs to PNGs --- so decodes TGA and encodes PNGs both directly, without Go's "automagical looking for the registered decoder". All works fine, source here
Now I have another use-case B which i can't seem to get working properly with the tga package:
So I must conclude: just importing tga unnamed/anonymously/side-effect-only screws up all other registered image decoders. Direct named import however does not seem to affect at least other encoders (not sure about other decoders, not a use-case right now).
(Note since I am in OpenGL my geometry just remains black but I verified that just importing ftrvxmtrx/tga as _ kills the whole image.Decode() functionality, removing the tga import all textures get decoded and loaded again perfectly.)
So not sure if tga is supposed to work as an unnamed / side-effect import like the other decoders or only directly... any thoughts? ;)
The text was updated successfully, but these errors were encountered: