I’m not good at English,so please consider about it.
I`m using this addon to load and display gif files : https://github.com/Geistyp/ofxGif
but when i load this gif image, the image seems broken
^ this is original gif file
^ and when i debug this code, gif image are displayed like this
#include “ofApp.h”
int index = 0;
//--------------------------------------------------------------
void ofApp::setup(){
gifloader.load(“view.gif”);
}
//--------------------------------------------------------------
void ofApp::update(){
if (ofGetElapsedTimeMillis() % 2)
{
index++;
if (index > gifloader.pages.size()-1) index = 0;
}
}
//--------------------------------------------------------------
void ofApp::draw(){
ofBackground(150,200,60);
ofSetColor(255, 255, 255, 255);
ofImage img = gifloader.pages[index];
ofPixels pix = img.getPixels();
ofPixels rpix = pix.getChannel(0);
ofPixels gpix = pix.getChannel(1);
ofPixels bpix = pix.getChannel(2);
pix.setChannel(0, rpix);
pix.setChannel(1, gpix);
pix.setChannel(2, bpix);
img.setFromPixels(pix);
img.draw(100, 100);
}
thank you for help me