Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- '%gregwar_image.throw_exception%'
- '%gregwar_image.fallback_image%'

Gregwar\ImageBundle\Services\ImageHandlingInterface: '@image.handling'

# Helper Twig
twig.extension.image:
class: Gregwar\ImageBundle\Extensions\ImageTwig
Expand Down
2 changes: 1 addition & 1 deletion Services/ImageHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @author Gregwar <[email protected]>
* @author Sullivan Senechal <[email protected]>
*/
class ImageHandling
class ImageHandling implements ImageHandlingInterface
{
/**
* @var string
Expand Down
29 changes: 29 additions & 0 deletions Services/ImageHandlingInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php


namespace Gregwar\ImageBundle\Services;


use Gregwar\ImageBundle\ImageHandler;

interface ImageHandlingInterface
{
/**
* Get a manipulable image instance.
*
* @param string $file the image path
*
* @return ImageHandler a manipulable image instance
*/
public function open($file);

/**
* Get a new image.
*
* @param string $w the width
* @param string $h the height
*
* @return ImageHandler a manipulable image instance
*/
public function create($w, $h);
}