Package sk.iway.iwcm.common
Class ImageTools
java.lang.Object
sk.iway.iwcm.common.ImageTools
Manipulacia s obrazkami
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconvertCmykToRgb(String filePath) Skonvertuje fotku do RGB ak je v CMYK, ak je konverzia povolena.static StringconvertImageFormat(IwcmFile imageFile, String targetFormat) Convert image to target format (jpg, png, gif).static intstatic intstatic Stringziska prikaz programu Identify (sucast Imagemagick)static Stringprikaz mogrify funguje rovnako ako convert ale ma ako parameter iba jednu cestu, prepisuje povodny vstupny subor http://www.imagemagick.org/www/mogrify.htmlstatic booleanReturns true if fileName is image file (ends with .jpg, png...)static intresizeImage(String srcUrl, int width, int height) Resizne obrazok, vrati: 0-vsetko je OK 1-obrazok je uz teraz mensi 2-nepodarilo sa ulozit obrazok 3-nastala neznama chyba 4-obrazok je v nepodporovanom formatestatic intresizeImage(IwcmFile imageFile, int width, int height) static introtateImage(String srcUrl, double angle) static introtateImage(IwcmFile imageFile, double angle)
-
Method Details
-
isImage
Returns true if fileName is image file (ends with .jpg, png...)- Parameters:
fileName-- Returns:
-
resizeImage
-
resizeImage
Resizne obrazok, vrati: 0-vsetko je OK 1-obrazok je uz teraz mensi 2-nepodarilo sa ulozit obrazok 3-nastala neznama chyba 4-obrazok je v nepodporovanom formate- Parameters:
srcUrl- - url adresa obrazkuwidth- - sirkaheight- - vyska- Returns:
-
cropImage
-
cropImage
-
rotateImage
-
rotateImage
-
convertCmykToRgb
Skonvertuje fotku do RGB ak je v CMYK, ak je konverzia povolena.- Parameters:
filePath-
-
getIdentifyRuntimeFile
ziska prikaz programu Identify (sucast Imagemagick)- Returns:
-
getMogrifyRuntimeFile
prikaz mogrify funguje rovnako ako convert ale ma ako parameter iba jednu cestu, prepisuje povodny vstupny subor http://www.imagemagick.org/www/mogrify.html- Returns:
-
convertImageFormat
Convert image to target format (jpg, png, gif). If image is already in target format, no conversion is done and null is returned.- Parameters:
imageFile-targetFormat-- Returns:
- - new file name (without path) if conversion was done, null otherwise
-