Я разрабатываю приложение для iPad, в котором представлены фотографии фотографа. Эти фотографии загружаются на веб-сервер и обслуживаются непосредственно через приложение, где они загружаются и отображаются с помощью метода, описанного ниже:
if([[NSFileManager defaultManager] fileExistsAtPath:[url path]]){
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL);
CGImageRef cgImage = nil;
if(source){
cgImage = CGImageSourceCreateImageAtIndex(source, 0, (CFDictionaryRef)dict);
}
UIImage *retImage = [UIImage imageWithCGImage:cgImage];
if(cgImage){
CGImageRelease(cgImage);
}
if(source){
CFRelease(source);
}
return retImage;
}
Я могу наблюдать серьезные изменения в отображении цветов фотографий между исходным изображением (которое одинаково при отображении с диска или из Интернета на моем Mac и Mac фотографа) и на iPad (результат неверен в приложение и даже в Safari).
После некоторого поиска я нашел несколько сообщений, объясняющих, как iDevices не используют встроенный цветовой профиль, поэтому я понял, что иду по этому пути. Фотографии сохраняются с использованием следующей информации:
Я узнал о некоторых статьях (например, эта ссылка от imageoptim или analogsenses), что я должен сохранить изображение для экспорта устройства, преобразовав его в sRGB, без встраивания цветового профиля, но я не могу понять, как это сделать? Каждый раз, когда я пытался (у меня нет фотошопа, поэтому я использовал командную строку ImageMagick), результирующее изображение содержало следующую информацию и по-прежнему неправильно отображалось на моем iPad (и любых других iPad, которые я тестировал):
Вот пример изображения, которое неправильно отображается на iPhone или iPad. но работает в Интернете
Я хотел бы преобразовать его, чтобы отображать его правильно, любая идея будет очень приветствоваться :)
[EDIT] Мне удалось получить правильное изображение, используя параметры фотошопа «сохранить для Интернета», используя следующие параметры: Но я все еще не могу применить эти настройки автоматически ко всем мои картинки.