0

I'm creating a website with Laminas (new zend framework).

And I have to resize the upload images. The images are NOT being upload using zend form as I created a dropzone.

The thing is that I need to do some resizing in the controller. Previously with Zend, I was using ImageSize, but it seems to not be ready for laminas. The code was:

require_once APPLICATION_PATH . '/../library/Zend/Filter/ImageSize.php';
$filter = new Users_Form_Users_Filter_ImageSize();

But neither that php file nor that class seems to be in Laminas, and when I google Laminas Image size, I only find the validation but not the resizing.

Is there a way to do this? As I need to generate the thumbnail and other image sizes.

Thanks!

Faabass
  • 1,394
  • 8
  • 29
  • 58

2 Answers2

1

Zend never included Zend/Filter/ImageSize in their library/packages.

Take a look here:

As you can see, there is no Zend/Filter/ImageSize nor Zend_Filter_ImageSize class.

The only thing you can find on github matching that classname is this project, which isn't part of zend (or laminas).

If you need it outside a Zend/Laminas application (like a script that must be executed from CLI), you can still use it (composer install flagbit/zend-filter-imagesize), althought I'd suggest you to take a look at the code and re-write it (I mean, that package has not been updated since 2013! ).

In the end, it won't be a lot of work, since the "core" has been already implemented, it will be just an update to newer standards and packages (and to be compatible with laminas, since this works only with big ol' ZF1)

Ermenegildo
  • 1,286
  • 1
  • 12
  • 19
0

May be this can be useful

This is not part of laminas but can be integrated via composer

https://imagine.readthedocs.io/en/stable/

regards

Fabrizio
  • 21
  • 2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – lukaszberwid Sep 14 '20 at 15:35