ftrvxmtrx / tga Goto Github PK
View Code? Open in Web Editor NEWGo package for decoding and encoding TARGA image format
License: MIT License
Go package for decoding and encoding TARGA image format
License: MIT License
Go already supports Palette and Gray models, so at least some colormapped/monochrome images can be stored in Go without much convertion.
Takes less space too.
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 http://go.pkgdoc.org/github.com/ftrvxmtrx/tga link in README should be updated to https://godoc.org/github.com/ftrvxmtrx/tga.
I'm pretty sure (but not 100% convinced as it's possible I'm misunderstanding something) that rgb32_top_left_rle_colormap.tga
isn't actually a valid TGA file.
I've run it through TGAPACK.EXE
from Truevision's TGA Utilities Package (with the -unpack
option and also having removed the footer as it doesn't like footers) and the resulting file has indices out of the range of the colour map. Some TGA loaders are giving an error related to this, but I've seen a lot of incomplete and broken TGA loaders over the past couple of weeks, so I'm not reading too much into that. It's completely possible that the image would work fine if someone tried loading it on an actual Truevision card. If so, I'd be thankful for an explanation of what's going on.
https://github.com/Mortdeus/go-tga
Its not the full spec, but its 32 bit rgba TGA encoder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.