2013-02-01 37 views
6

मेरे पास एम्बेडेड रंग प्रोफ़ाइल वाला एक जेपीईजी-चित्र है। कुछ वेब ब्राउज़र लागू प्रोफ़ाइल के साथ छवि दिखाते हैं, कुछ नहीं। छवि पर रंग प्रोफाइल कैसे लागू करें और प्रोफ़ाइल हटाएं, कि सभी ब्राउज़र समान रूप से छवि प्रदर्शित करते हैं।छवि में निर्मित रंग प्रोफाइल लागू करें

मैं छवि जादुई करिश्मों विस्तार से समस्या को हल करने की कोशिश की, लेकिन छवि अभी भी विभिन्न ब्राउज़रों में अलग दिखाने:

function add_color_profiles($source_path, $target_path){ 

      $all_exts = get_loaded_extensions(); 
      if(!in_array('imagick',$all_exts)) 
        return true; 

      $im1 = new Imagick($source_path); 
      $im2 = new Imagick($target_path); 

      $profiles = $im1->getImageProfiles(); 


      if(!$profiles) 
        return true; 

      foreach($profiles as $name => $profile){ 

        $im2->setImageProfile($name,$profile); 
      } 

      $im2->writeImage ($target_path); 

      return true; 
    } 

उत्तर

3

एक छवि के लिए प्रोफ़ाइल लागू करें (आरजीबी करने के लिए छवि colorspace परिवर्तित):

$im->setImageColorspace(IMagick::COLORSPACE_RGB); 

पट्टी आउटपुट फ़ाइल से प्रोफाइल जानकारी:

$im->profileImage('*', NULL); 

सभी प्रोफाइल की एक छवि पट्टी es, exif (टिप्पणियां जीपीएस डेटा इत्यादि):

$im->stripImage();