Veo que a veces el tamaño del NSImage no es de tamaño real (con algunas imágenes) y el tamaño de CIImage es siempre real. Estaba probando con este image.tamaño de NSImagemage no tamaño real con algunas imágenes?
Este es el código fuente que escribí para la prueba:
NSImage *_imageNSImage = [[NSImage alloc]initWithContentsOfFile:@"<path to image>"];
NSSize _dimensions = [_imageNSImage size];
[_imageNSImage release];
NSLog(@"Width from CIImage: %f",_dimensions.width);
NSLog(@"Height from CIImage: %f",_dimensions.height);
NSURL *_myURL = [NSURL fileURLWithPath:@"<path to image>"];
CIImage *_imageCIImage = [CIImage imageWithContentsOfURL:_myURL];
NSRect _rectFromCIImage = [_imageCIImage extent];
NSLog(@"Width from CIImage: %f",_rectFromCIImage.size.width);
NSLog(@"Height from CIImage: %f",_rectFromCIImage.size.height);
y la salida es:
Así que cómo puede ser ?? Tal vez estoy haciendo algo mal?
Gracias por el gran fondo de pantalla! – JustSid
@JustSid De nada :) –