0
ich folgende Fehlermeldung erhalten, wenn einige JPEG-Daten zu komprimieren versucht, mit UIImageJPEGRepresentation(image, 0.5f);
Fehler bei der JPEG-Komprimierung von Daten unter Verwendung von
<Error>: Unsupported pixel description - 4 components, 8 bits-per-component, 32 bits-per-pixel
<Error>: CGBitmapContextCreateWithDictionary: failed to create delegate.
<Error>: CGImageDestinationAddImage image could not be converted to destination format.
<Error>: CGImageDestinationFinalize image destination does not have enough images
Hier ist der Code-Schnipsel, wo ich herunterladen und die Daten komprimieren ...
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:object.largeimage]];
[request startSynchronous];
NSData *imageData = [request responseData];
UIImage *image = [[UIImage alloc] initWithData:imageData];
NSData *compressedImageData = UIImageJPEGRepresentation(image, 0.5f);
//If the data was compressed properly...
if(compressedImageData) [compressedImageData writeToFile:filePath atomically:YES];
//If it wasn't...
else [imageData writeToFile:filePath atomically:YES];
[image release];
if(request.responseStatusCode == 200)
object.fullImageFilename = filePath;
[request release];
[Anfrage freigeben];
Vielen Dank im Voraus für jede Hilfe :)
Diese Problemumgehung hat mich gerettet viele interessiert von Zeit. Danke für das Teilen. In einem Stapel von 20.000 JPEG-Fotos, die ich in einer Datenbank speichern muss, ist dieser Fehler bei etwa 250 von ihnen aufgetreten. Wir wissen immer noch nicht warum ... – Bjinse