PHP Doku:: Adds or removes a profile from an image - function.imagick-profileimage.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzBildverarbeitung und -generierungImage Processing (ImageMagick)The Imagick classImagick::profileImage

Ein Service von Reinhard Neidl - Webprogrammierung.

The Imagick class

<<Imagick::previousImage

Imagick::quantizeImage>>

Imagick::profileImage

(PECL imagick 2.0.0)

Imagick::profileImageAdds or removes a profile from an image

Beschreibung

bool Imagick::profileImage ( string $name , string $profile )
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.

Adds or removes a ICC, IPTC, or generic profile from an image. If the profile is NULL, it is removed from the image otherwise added. Use a name of '*' and a profile of NULL to remove all profiles from the image.

Parameter-Liste

name

profile

Rückgabewerte

Liefert TRUE bei Erfolg.

Fehler/Exceptions

Wirft ImagickException bei Fehlern.


2 BenutzerBeiträge:
- Beiträge aktualisieren...
gavin at softyolk dot com
12.07.2009 13:28
Thanks for this very valuable information.
For a further push in the correct direction please
consider that you have to download the profiles,

and your most likely sources are:

http://www.color.org/srgbprofiles.xalter

and

http://www.adobe.com/support/downloads/product.jsp?product=62&platform=Windows

Note that the profiles are free, but you must install them
to make them available on you host system.
Eero Niemi (eero at eero dot info)
29.04.2008 16:01
If you need to convert images that are on CMYK format into RGB and want to preserve colour information, this may be helpful:

<?php
$image
= new Imagick("CMYK_image.jpg"); // load image
$profiles = $image->getImageProfiles('*', false); // get profiles
$has_icc_profile = (array_search('icc', $profiles) !== false); // we're interested if ICC profile(s) exist

if ($has_icc_profile === false)
{
 
// image does not have CMYK ICC profile, we add one
 
$icc_cmyk = file_get_contents('/path/to/icc/SomeCMYKProfile.icc');
 
$image->profileImage('icc', $icc_cmyk);
}

// Then we need to add RGB profile
$icc_rgb = file_get_contents('/path/to/icc/SomeRGBProfile.icc');
$image->profileImage('icc', $icc_rgb);

$image->setImageColorSpace(Imagick::COLORSPACE_RGB);

$image->writeImage("RGB_image.jpg");

?>

There may be better and more elegant ways to do this, but hope this helped.



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)