-
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
OctoberUtil
- ComposerScript
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- ProjectSet
- ProjectSync
- ThemeCheck
- ThemeInstall
- ThemeList
- ThemeRemove
- ThemeSync
- ThemeUse
-
-
Controllers
-
Database
-
Facades
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
resizer
-
router
-
template
-
theme
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
- afterBoot
- afterCreate
- afterDelete
- afterFetch
- afterRestore
- afterSave
- afterUpdate
- afterValidate
- beforeCreate
- beforeDelete
- beforeFetch
- beforeGetAttribute
- beforeRestore
- beforeSave
- beforeSetAttribute
- beforeUpdate
- beforeValidate
- getAttribute
- saveInternal
- setAttribute
-
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
resizer
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
- BaseCssFilter
- CallablesFilter
- CssCacheBustingFilter
- CssImportFilter
- CssMinFilter
- CssRewriteFilter
- FilterCollection
- JavascriptImporter
- JSMinFilter
- JSMinPlusFilter
- JSqueezeFilter
- LessCompiler
- LessphpFilter
- MinifyCssCompressorFilter
- PackagerFilter
- PackerFilter
- ScssCompiler
- ScssphpFilter
- StylesheetMinify
-
Util
- README
- AssetManager
- AssetWriter
- FilterManager
-
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Parsedown
-
Syntax
- Bracket
- Ini
- Markdown
- MarkdownData
- ParseServiceProvider
- Twig
- Yaml
-
-
Process
-
Resize
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Library
- Resize
- Resizer
October\Rain\Resize\Resizer
Resizer for images
Protected properties
protected Resource $file
The symfony uploaded file object.
protected string $extension
extension of the uploaded file
protected string $mime
mime type of the uploaded file
protected Resource $image
image (on disk) that's being resized
protected Resource $originalImage
originalImage cached
protected int $width
width of the original image being resized
protected int $height
height of the original image being resized
protected int|null $orientation
orientation (Exif) of image
protected array $options
options used for resizing
Public methods
public void __construct(mixed $file)
__construct instantiates the Resizer and receives the path to an image we're working with
Parameters
- mixed $file - The file array provided by Laravel's Input::file('field_name') or a path to a file
public void crop(int $cropStartX, int $cropStartY, int $newWidth, int $newHeight, int $srcWidth=NULL, int $srcHeight=NULL)
Crops an image from its center
Parameters
- int $cropStartX - Start on X axis
- int $cropStartY - Start on Y axis
- int $newWidth - The new width
- int $newHeight - The new height
- int $srcWidth - Source area width.
- int $srcHeight - Source area height.
public static Resizer open(mixed $file)
Static call, Laravel style. Returns a new Resizer object, allowing for chainable calls
Parameters
- mixed $file - The file array provided by Laravel's Input::file('field_name') or a path to a file
public void reset()
reset the image back to the original.
public void resize(int $newWidth, int $newHeight, array $options=array())
resize and/or crop an image
Parameters
- int $newWidth - The width of the image
- int $newHeight - The height of the image
- array $options - A set of resizing options
public void save(string $savePath)
save the image based on its file type.
Parameters
- string $savePath - Where to save the image
public void setOptions($options)
setOptions sets resizer options. Available options are:
- mode: Either exact, portrait, landscape, auto, fit or crop.
- offset: The offset of the crop = [ left, top ]
- sharpen: Sharpen image, from 0 - 100 (default: 0)
- interlace: Interlace image, Boolean: false (disabled: default), true (enabled)
- quality: Image quality, from 0 - 100 (default: 90)
Parameters
- $options
public void sharpen(int $sharpness)
sharpen the image across a scale of 0 - 100
Parameters
- int $sharpness
Protected methods
protected array getDimensions(int $newWidth, int $newHeight)
getDimensions returns the image dimensions based on the option that was chosen.
Parameters
- int $newWidth - The width of the image
- int $newHeight - The height of the image
protected int getHeight()
getHeight receives the image's height while respecting the exif orientation
protected void getOptimalCrop(int $newWidth, int $newHeight)
getOptimalCrop attempts to find the best way to crop. Whether crop is based on the image being portrait or landscape.
Parameters
- int $newWidth - The width of the image
- int $newHeight - The height of the image
protected mixed getOption(string $option)
getOption gets an individual resizer option
Parameters
- string $option - Option name to get
protected int|null getOrientation(Symfony\Component\HttpFoundation\File\File $file)
getOrientation receives the image's exif orientation
Parameters
- Symfony\Component\HttpFoundation\File\File $file
protected resource getRotatedOriginal()
getRotatedOriginal receives the original but rotated image according to exif orientation
protected void getSizeByAuto(int $newWidth, int $newHeight)
getSizeByAuto checks to see if an image is portrait or landscape and resizes accordingly.
Parameters
- int $newWidth - The width of the image
- int $newHeight - The height of the image
protected void getSizeByFit(int $maxWidth, int $maxHeight)
getSizeByFit fits the image inside a bounding box using maximum width and height constraints.
Parameters
- int $maxWidth - The maximum width of the image
- int $maxHeight - The maximum height of the image
protected int getSizeByFixedHeight(int $newHeight)
getSizeByFixedHeight returns the width based on the image height
Parameters
- int $newHeight - The height of the image
protected int getSizeByFixedWidth(int $newWidth)
Returns the height based on the image width
Parameters
- int $newWidth - The width of the image
protected int getWidth()
getWidth receives the image's width while respecting the exif orientation
protected mixed openImage(Symfony\Component\HttpFoundation\File\File $file)
openImage opens a file, detect its mime-type and create an image resource from it
Parameters
- Symfony\Component\HttpFoundation\File\File $file - File instance
protected void retainImageTransparency($img)
retainImageTransparency manipulates an image resource in order to keep transparency for PNG and GIF files.
Parameters
- $img
protected void setOption(string $option, mixed $value)
setOption sets an individual resizer option
Parameters
- string $option - Option name to set
- mixed $value - Option value to set