dolibarr 18.0.6
|
Set of function for manipulating images. More...
Go to the source code of this file.
Functions | |
getDefaultImageSizes () | |
Return default values for image sizes. | |
getListOfPossibleImageExt ($acceptsvg=0) | |
Return if a filename is file name of a supported image format. | |
image_format_supported ($file, $acceptsvg=0) | |
Return if a filename is file name of a supported image format. | |
dol_getImageSize ($file, $url=false) | |
Return size of image file on disk (Supported extensions are gif, jpg, png, bmp and webp) | |
dol_imageResizeOrCrop ($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0, $filetowrite='', $newquality=0) | |
Resize or crop an image file (Supported extensions are gif, jpg, png, bmp and webp) | |
dolRotateImage ($file_path) | |
dolRotateImage if image is a jpg file. | |
correctExifImageOrientation ($fileSource, $fileDest, $quality=95) | |
Add exif orientation correction for image. | |
vignette ($file, $maxWidth=160, $maxHeight=120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0) | |
Create a thumbnail from an image file (Supported extensions are gif, jpg, png and bmp). | |
Set of function for manipulating images.
Definition in file images.lib.php.
correctExifImageOrientation | ( | $fileSource, | |
$fileDest, | |||
$quality = 95 ) |
Add exif orientation correction for image.
string | $fileSource | Full path to source image to rotate |
string | bool | $fileDest | string : Full path to image to rotate | false return gd img | null the raw image stream will be outputted directly |
int | $quality | output image quality |
Definition at line 425 of file images.lib.php.
Referenced by dolRotateImage().
dol_getImageSize | ( | $file, | |
$url = false ) |
Return size of image file on disk (Supported extensions are gif, jpg, png, bmp and webp)
string | $file | Full path name of file |
bool | $url | Image with url (true or false) |
Definition at line 140 of file images.lib.php.
References dol_osencode(), and image_format_supported().
Referenced by pdf_standard\Add_PDF_card(), pdf_standardlabel\Add_PDF_label(), pdf_getHeightForLogo(), pdf_getSizeForImage(), and CommonObject\show_photos().
dol_imageResizeOrCrop | ( | $file, | |
$mode, | |||
$newWidth, | |||
$newHeight, | |||
$src_x = 0, | |||
$src_y = 0, | |||
$filetowrite = '', | |||
$newquality = 0 ) |
Resize or crop an image file (Supported extensions are gif, jpg, png, bmp and webp)
string | $file | Path of source file to resize/crop |
int | $mode | 0=Resize, 1=Crop |
int | $newWidth | Largeur maximum que dois faire l'image destination (0=keep ratio) |
int | $newHeight | Hauteur maximum que dois faire l'image destination (0=keep ratio) |
int | $src_x | Position of croping image in source image (not use if mode=0) |
int | $src_y | Position of croping image in source image (not use if mode=0) |
string | $filetowrite | Path of file to write (overwrite source file if not provided) |
int | $newquality | Value for the new quality of image, for supported format (use 0 for maximum/unchanged). |
Definition at line 181 of file images.lib.php.
References dol_osencode(), dol_syslog(), dolChmod(), and image_format_supported().
dolRotateImage | ( | $file_path | ) |
dolRotateImage if image is a jpg file.
Currently use an autodetection to know if we can rotate. TODO Introduce a new parameter to force rotate.
string | $file_path | Full path to image to rotate |
Definition at line 411 of file images.lib.php.
References correctExifImageOrientation().
getDefaultImageSizes | ( | ) |
Return default values for image sizes.
Definition at line 38 of file images.lib.php.
Referenced by CommonObject\addThumbs(), and dol_add_file_process().
getListOfPossibleImageExt | ( | $acceptsvg = 0 | ) |
Return if a filename is file name of a supported image format.
int | $acceptsvg | 0=Default (depends on setup), 1=Always accept SVG as image files |
Definition at line 61 of file images.lib.php.
Referenced by image_format_supported().
image_format_supported | ( | $file, | |
$acceptsvg = 0 ) |
Return if a filename is file name of a supported image format.
string | $file | Filename |
int | $acceptsvg | 0=Default (depends on setup), 1=Always accept SVG as image files |
Definition at line 80 of file images.lib.php.
References getListOfPossibleImageExt().
Referenced by Ticket\copyFilesForTicket(), dol_add_file_process(), dol_getImageSize(), dol_imageResizeOrCrop(), Product\is_photo_available(), FormFile\list_of_documents(), Product\liste_photos(), CommonObject\show_photos(), and vignette().
vignette | ( | $file, | |
$maxWidth = 160, | |||
$maxHeight = 120, | |||
$extName = '_small', | |||
$quality = 50, | |||
$outdir = 'thumbs', | |||
$targetformat = 0 ) |
Create a thumbnail from an image file (Supported extensions are gif, jpg, png and bmp).
If file is myfile.jpg, new file may be myfile_small.jpg
string | $file | Path of source file to resize |
int | $maxWidth | Largeur maximum que dois faire la miniature (-1=unchanged, 160 by default) |
int | $maxHeight | Hauteur maximum que dois faire l'image (-1=unchanged, 120 by default) |
string | $extName | Extension to differenciate thumb file name ('_small', '_mini') |
int | $quality | Quality of compression (0=worst, 100=best) |
string | $outdir | Directory where to store thumb |
int | $targetformat | New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep old format) |
Definition at line 509 of file images.lib.php.
References dol_mkdir(), dol_osencode(), dol_syslog(), dolChmod(), getImageFileNameForSize(), and image_format_supported().
Referenced by CommonObject\addThumbs(), Ticket\copyFilesForTicket(), FileUpload\createScaledImage(), and dol_add_file_process().