ios - how to solve "ImageIO: JPEG Application transferred too few scanlines" -
when save image album, failed.
error info: peg application transferred few scanlines
anyone has ever met this? thanks.
// make data provider data. float32 picsize = texture->image_size.width * texture->image_size.height * texture->bytesperpixel; nslog(@"pic size:%f", picsize); cgdataproviderref provider = cgdataprovidercreatewithdata(null, texture->data, texture->image_size.width * texture->image_size.height * texture->bytesperpixel, null); // prep ingredients int bitspercomponent = 8; int bitsperpixel = 32; int bytesperrow = 4 * 320; cgcolorspaceref colorspaceref = cgcolorspacecreatedevicergb(); cgbitmapinfo bitmapinfo = kcgbitmapbyteorderdefault; cgcolorrenderingintent renderingintent = kcgrenderingintentdefault; // make cgimage cgimageref imageref = cgimagecreate(320, 480, bitspercomponent, bitsperpixel, bytesperrow, colorspaceref, bitmapinfo, provider, null, no, renderingintent); // make uiimage uiimage *myimage = [uiimage imagewithcgimage:imageref]; uiimagewritetosavedphotosalbum(myimage, self, nil, nil);
hey similar thread. have seen ? .this thread references same problem in detail. go through link
Comments
Post a Comment