OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\UtilsPic Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Core\UtilsPic:
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\UtilsPic:

Public Member Functions

 resizeImage ($sSrc, $sTarget, $iDesiredWidth, $iDesiredHeight)
 
 safePictureDelete ($sPicName, $sAbsDynImageDir, $sTable, $sField)
 
 overwritePic ($oObject, $sPicTable, $sPicField, $sPicType, $sPicDir, $aParams, $sAbsDynImageDir)
 

Protected Member Functions

 _deletePicture ($sPicName, $sAbsDynImageDir)
 
 _isPicDeletable ($sPicName, $sTable, $sField)
 
 fetchIsImageDeletable ($sPicName, $sTable, $sField)
 
 _resizeGif ($sSrc, $sTarget, $iNewWidth, $iNewHeight, $iOriginalWidth, $iOriginalHeigth, $iGDVer, $blDisableTouch)
 
 _resize ($aImageInfo, $sSrc, $hDestinationImage, $sTarget, $iNewWidth, $iNewHeight, $iGdVer, $blDisableTouch, $iDefQuality)
 
 _copyAlteredImage ($sDestinationImage, $sSourceImage, $iNewWidth, $iNewHeight, $aImageInfo, $sTarget, $iGdVer, $blDisableTouch)
 

Protected Attributes

 $_aImageTypes = ["GIF" => IMAGETYPE_GIF, "JPG" => IMAGETYPE_JPEG, "PNG" => IMAGETYPE_PNG, "JPEG" => IMAGETYPE_JPEG]
 

Detailed Description

Including pictures generator functions fileImage manipulation class

Member Function Documentation

◆ _copyAlteredImage()

OxidEsales\EshopCommunity\Core\UtilsPic::_copyAlteredImage (   $sDestinationImage,
  $sSourceImage,
  $iNewWidth,
  $iNewHeight,
  $aImageInfo,
  $sTarget,
  $iGdVer,
  $blDisableTouch 
)
protected

create and copy the resized image

Parameters
string$sDestinationImagefile + path of destination
string$sSourceImagefile + path of source
int$iNewWidthnew width of the image
int$iNewHeightnew height of the image
array$aImageInfoadditional info
string$sTargettarget file path
int$iGdVerused gd version
bool$blDisableTouchwether Touch() should be called or not
Returns
null

◆ _deletePicture()

OxidEsales\EshopCommunity\Core\UtilsPic::_deletePicture (   $sPicName,
  $sAbsDynImageDir 
)
protected

Removes picture file from disk.

Parameters
string$sPicNamename of picture
string$sAbsDynImageDirthe absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false))
Returns
null

◆ _isPicDeletable()

OxidEsales\EshopCommunity\Core\UtilsPic::_isPicDeletable (   $sPicName,
  $sTable,
  $sField 
)
protected

Checks if current picture file is used in more than one table entry, returns true if one, false if more than one.

Parameters
string$sPicNameName of picture file
string$sTablein which table
string$sFieldtable field value
Returns
bool

◆ _resize()

OxidEsales\EshopCommunity\Core\UtilsPic::_resize (   $aImageInfo,
  $sSrc,
  $hDestinationImage,
  $sTarget,
  $iNewWidth,
  $iNewHeight,
  $iGdVer,
  $blDisableTouch,
  $iDefQuality 
)
protected

type dependant image resizing

Parameters
array$aImageInfoContains information on image's type / width / height
string$sSrcsource image
string$hDestinationImageDestination Image
string$sTargetResized Image target
int$iNewWidthResized Image's width
int$iNewHeightResized Image's height
mixed$iGdVerused GDVersion, if null or false returns false
bool$blDisableTouchfalse if "touch()" should be called for gif resizing
string$iDefQualityquality for "imagejpeg" function
Returns
bool

◆ _resizeGif()

OxidEsales\EshopCommunity\Core\UtilsPic::_resizeGif (   $sSrc,
  $sTarget,
  $iNewWidth,
  $iNewHeight,
  $iOriginalWidth,
  $iOriginalHeigth,
  $iGDVer,
  $blDisableTouch 
)
protected

Resizes and saves GIF image. This method was separated due to GIF transparency problems.

Parameters
string$sSrcimage file
string$sTargetdestination file
int$iNewWidthnew width
int$iNewHeightnew height
int$iOriginalWidthoriginal width
int$iOriginalHeigthoriginal height
int$iGDVerGD packet version
bool$blDisableTouchfalse if "touch()" should be called
Returns
bool

◆ fetchIsImageDeletable()

OxidEsales\EshopCommunity\Core\UtilsPic::fetchIsImageDeletable (   $sPicName,
  $sTable,
  $sField 
)
protected

Fetch the information, if the given image is deletable from the database.

Parameters
string$sPicNameName of image file.
string$sTableThe table in which we search for the image.
string$sFieldThe value of the table field.
Returns
mixed

◆ overwritePic()

OxidEsales\EshopCommunity\Core\UtilsPic::overwritePic (   $oObject,
  $sPicTable,
  $sPicField,
  $sPicType,
  $sPicDir,
  $aParams,
  $sAbsDynImageDir 
)

Deletes picture if new is uploaded or changed

Parameters
object$oObjectin whitch obejct search for old values
string$sPicTablepictures table
string$sPicFieldwhere picture are stored
string$sPicTypehow does it call in $_FILE array
string$sPicDirdirectory of pic
array$aParamsnew input text array
string$sAbsDynImageDirthe absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false))
Returns
null

◆ resizeImage()

OxidEsales\EshopCommunity\Core\UtilsPic::resizeImage (   $sSrc,
  $sTarget,
  $iDesiredWidth,
  $iDesiredHeight 
)

Resizes image to desired width and height, returns true on success.

Parameters
string$sSrcSource of image file
string$sTargetTarget to write resized image file
mixed$iDesiredWidthWidth of resized image
mixed$iDesiredHeightHeight of resized image
Returns
bool

◆ safePictureDelete()

OxidEsales\EshopCommunity\Core\UtilsPic::safePictureDelete (   $sPicName,
  $sAbsDynImageDir,
  $sTable,
  $sField 
)

deletes the given picutre and checks before if the picture is deletable

Parameters
string$sPicNameName of picture file
string$sAbsDynImageDirthe absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false))
string$sTablein which table
string$sFieldtable field value
Returns
bool

Member Data Documentation

◆ $_aImageTypes

OxidEsales\EshopCommunity\Core\UtilsPic::$_aImageTypes = ["GIF" => IMAGETYPE_GIF, "JPG" => IMAGETYPE_JPEG, "PNG" => IMAGETYPE_PNG, "JPEG" => IMAGETYPE_JPEG]
protected

The documentation for this class was generated from the following file: