IMG_ImageIO.m
branchSDL-1.2
changeset 607 1a1189c2978f
parent 308 ea460af4ceff
     1.1 --- a/IMG_ImageIO.m	Tue Oct 16 10:50:15 2018 +0300
     1.2 +++ b/IMG_ImageIO.m	Tue Oct 16 20:02:02 2018 +0300
     1.3 @@ -217,13 +217,13 @@
     1.4  	 * libpng loader.
     1.5  	 * Thanks to Allegro. :)
     1.6  	 */
     1.7 -	CGFloat whitePoint[3] = { 1, 1, 1 };
     1.8 -	CGFloat blackPoint[3] = { 0, 0, 0 };
     1.9 +	CGFloat whitePoint[3] = { 0.950, 1.000, 1.089 };
    1.10 +	CGFloat blackPoint[3] = { 0.000, 0.000, 0.000 };
    1.11  	CGFloat gamma[3] = { 2.2, 2.2, 2.2 };
    1.12  	CGFloat matrix[9] = {
    1.13 -		1, 1, 1,
    1.14 -		1, 1, 1,
    1.15 -		1, 1, 1
    1.16 +		0.412, 0.213, 0.019,
    1.17 +		0.358, 0.715, 0.119,
    1.18 +		0.180, 0.072, 0.950
    1.19  	};
    1.20  	CGColorSpaceRef color_space =
    1.21  		CGColorSpaceCreateCalibratedRGB(
    1.22 @@ -521,7 +521,7 @@
    1.23          }
    1.24      }
    1.25      
    1.26 -    // reset the file descption pointer
    1.27 +    // reset the file pointer
    1.28      SDL_RWseek(rw_ops, start, SEEK_SET);
    1.29  
    1.30  #endif  /* #if defined(ALLOW_UIIMAGE_FALLBACK) && ((TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1)) */
    1.31 @@ -532,6 +532,7 @@
    1.32  {
    1.33      int is_type = 0;
    1.34      
    1.35 +    Sint32 start = SDL_RWtell(rw_ops);
    1.36      CFDictionaryRef hint_dictionary = CreateHintDictionary(uti_string_to_test);	
    1.37      CGImageSourceRef image_source = CreateCGImageSourceFromRWops(rw_ops, hint_dictionary);
    1.38      
    1.39 @@ -540,6 +541,8 @@
    1.40      }
    1.41      
    1.42      if (NULL == image_source) {
    1.43 +        // reset the file pointer
    1.44 +        SDL_RWseek(rw_ops, start, SEEK_SET);
    1.45          return 0;
    1.46      }
    1.47      
    1.48 @@ -555,6 +558,9 @@
    1.49      is_type = (int)UTTypeConformsTo(uti_string_to_test, uti_type);
    1.50      
    1.51      CFRelease(image_source);
    1.52 +
    1.53 +    // reset the file pointer
    1.54 +    SDL_RWseek(rw_ops, start, SEEK_SET);
    1.55      return is_type;
    1.56  }
    1.57