sxiv relies on media-libs/imlib2 to recognize image types. Compiling imlib2 without gif support leads to sxiv not being able to recognize gif images, and thus to read them (even though the reading uses media-libs/giflib). Please add media-libs/imlib2[gif] to RDEPENDS.
What about all the other formats that media-libs/imlib2 supports only when the right USE flags are enabled? Should those be added to every ebuild in the tree that might want to use it? Shouldn't that be up to everyone's individual considerations?
I don’t think lots of programs use one library to recognize a format, and another one to read it. In this case, the consequences of using -gif on media-libs/imlib2 were not clear at all. I had to browse the source code of sxiv to figure them out. Since sxiv can be compiled without giflib on the system (resulting on a build that doesn’t support gif images), a compromise could be to add the gif flag to media-gfx/sxiv, with no changes on the src_prepare() and src_install() procedures, and resulting in the following dependencies : gif? (media-libs/giflib) media-libs/imlib2[X,gif?]
Fixed in 1.3.2-r1.