christophlehmann / vips

TYPO3 Extension for faster thumbnail generation with PHP Module vips (libvips)
3 stars 0 forks source link

[Question] How to identify if vips was used? #1

Open the-hotmann opened 4 years ago

the-hotmann commented 4 years ago

I love this extension man! Was waiting for this one since more then a year now.

I also use another TYPO3 Extension (called WebP) but if I use the extension, the extension will use (see HERE) ImageMagick or GraphicsMagick, now my question is:

How can I know vips (libvips) was used creating the Image or not? How can I check (in TYPO3 Backend) if the extension can load the installed vips PHP module? Is there a way to do so? Becasue if I run the Image Processing Test I get shown this: Image Processing Test Showing that ImageMagick is getting used.

Thanks in advance!

P.S.: here is the Favicon from Vips, maybe you want to use ththis as ext_icon.gif in root directiry of the extension. favicon (GIF) favicon (PNG)

christophlehmann commented 4 years ago

Hey Martin,

to determine what creates your thumbnails you can implement logging.

In the reports backend module there is a check for the vips php module simply showing the version.

While developing it i only checked image generation in filelist + FE. IM/GM are used for things which are not supported by this extension (other file types/mask tasks/GIFBUILDER).

Thanks for the Extension icons!

the-hotmann commented 4 years ago

Maybe I have missunderstood what this extension is capable of.

Can this extension use VIPS to convert JPEG to WEBP? With VIPS ofc? Like:

vips webpsave image.jpeg image.webp

Or is is just getting used for thumbnails only? I would love to see VIPS getting used to do ALL the Image-Manupulation stuff in TYPO3 as it is faster at everything and consumes less memory.

If VIPS can be used systemwide is there something implemented to use it as individual Image Processor like this (orange field) TYPO3 Imagesprocessor

I just dont understand how this extension is working right now, or what exactly it does?

christophlehmann commented 4 years ago

The extension is just for thumbnailing with crop support, nothing else yet. PR's are welcome :)

From cores point of view there is currently no API which adds support for other tools than gm/im, but it's planned. Have you seen https://typo3.org/community/teams/typo3-development/initiatives/image-rendering ?

the-hotmann commented 4 years ago

I now used the extension on a TYPO3 v9.5.13 (Debian 9.11 Server) Installation and have to say: its not working at all.

When I activate the extension all Images are not even generated and just bypassed and the original is used. Everywhere! Means if I scale Images down for example from 6000x4000 to 600x400 its not happening, the original one just gets used.

When I installed the extension first everything looked good, but when I deleted all the assets (Remove Temporary Assets) they are not regenerating if the extension is installed. Here a little example with befor and after:

Befor: Vorher

After (vips extension installed): Nachher

As you see all the scaled down (processed) images are gone and just the original ones with the direct link are here. libvips is installed and working.

But to be honest there is no clear documentation of how to verify that everything is needed is also available. Also no errors in any Log.

Little example of my vips/libvips setup:

# vips -v
vips-8.4.5-Fri Jan 18 18:15:36 UTC 2019
# pkg-config vips --modversion
8.4.5

From PHP Info (vips related):

Vips headers version | 8.4.5
Vips library version | 8.4.5
Vips ABI version | -1.-1.-1
Major version | 8
Minor version | 4
Micro version | 5
Cache max mem | 104857600
Cache max operations | 1000
Cache current operations | 0
Cache max open files | 100
Concurrency | 4
SIMD support with liborc | yes
JPEG support | yes
PNG support | yes
TIFF support | yes
GIF support | yes
OpenEXR support | yes
load OpenSlide | yes
load Matlab | yes
load PDF | yes
load SVG | yes
FITS support | yes
WebP support | yes
HEIF support | no
load with libMagick | yes
Text rendering support | yes
ICC profile support with lcms | yes

"PHP Module vips Version 8.4.5" was btw also shown in the "System Reports" extension. So I assumed it is working.

For me it seems vips is installed and working. Is there anything else that should be installed? Is there anything else I should check to make sure the enviroment is ready to use this extension? For now I just deactivated the extension, as soon as I did so all the Images are correct again.

If you know what happened here or if I should test something feel free to advice me what exactly to do and I will test it.

christophlehmann commented 4 years ago

The thumbnail_image() function needs w/h parameter which may not set.

Can you check the commit?

I'm going to add some more debugging/logging

the-hotmann commented 4 years ago

Now something changed but went worse. Cant even activate the Extension.

VIPS Bug Maybe this Error was there even befor, I just turned on agressive debugging mode and this came up. But If this have been there befor, the extension never ever use VIPS to convert/process Images.

Then again the Fallback should work, but also did not work. Somehow strange.

The thumbnail_image() function needs w/h parameter which may not set.

Right, I normaly do just set the Width OR the Height parameter, mostly not both. But should not be a problem.

FYI: I'm not in composer Mode

christophlehmann commented 4 years ago

Strange.

You need the composer dependencies. To check it you can

  1. git clone ...
  2. Remove the requirement to typo3/cms-core in composer.json
  3. Run composer install in the extension directory
  4. Activate the extension

Does this work for you?

christophlehmann commented 4 years ago

If the compatibility class is not found you can also try to delete typo3conf/autoload which renews the class cache

the-hotmann commented 4 years ago

I think this Extension should shipp inside itself everything thats needed to run it, specially if it is listed in the TER, as everyone who downloads it there will have a crashing System without composer install.

But will try it and report back

EDIT:

No errors now, but same as befor: images are not getting processed, just originals are shown

christophlehmann commented 4 years ago

The TER versions are always shipped with the dependencies.

Did you check the attached commit?

the-hotmann commented 4 years ago

I did try it with the latest commit. It is not working for me, but as I said: no errors, nothing in the log

the-hotmann commented 4 years ago

Even if I download the version from TER (0.0.2) it does not work.

Still same result. Same behaviour like here --> https://github.com/christophlehmann/vips/issues/1#issuecomment-568808549

FaraFara commented 4 years ago

Even if I download the version from TER (0.0.2) it does not work.

* I downloaded the 0.0.2 from TER

* added the commit [6cc46d7](https://github.com/christophlehmann/vips/commit/6cc46d76356c031a7a9b95e4e1afff0aa5b0f76c) manually.

* cleared all cached.

Still same result. Same behaviour like here --> #1 (comment)

Confirm. I have same problems. And latest patch don't fix this.

christophlehmann commented 4 years ago

I added some logging (https://github.com/christophlehmann/vips#debugging)

Can you post your logs?

the-hotmann commented 4 years ago

I added some logging (https://github.com/christophlehmann/vips#debugging)

Can you post your logs?

  1. I downloaded the 0.0.2 from TER (to have all dependecys)
  2. then overwrite it with the latest dev version from here (f03eff044f9a0ff4c7aa00dfce4f5b169c0bf5a0)
  3. created the File typo3conf/AdditionalConfiguration.php pasted in the code from here (https://github.com/christophlehmann/vips#debugging)

Result:

  1. same as befor. No Images are getting processed (original Images unprocessed are getting delivered)
  2. I cant open "in the Backend the section "maintaining", as this error comes up $GLOBALS['TYPO3_CONF_VARS']['LOG']['Lemming']['Vips']['writerConfiguration'] = [ \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [ \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [ 'logFileInfix' => 'vips' ] ] ];{"success":true} This basically breaks my TYPO3 Backend (everything inside "Admin Tools").
  3. No Log File was created whats so ever.

Edit:

After deleting typo3conf/AdditionalConfiguration.php the "Admin Tools" section in the Backend is working again

the-hotmann commented 4 years ago

@christophlehmann could you tell us a bit more about your setup? Debian? 8? 9? 10? CentOS?

Which vips version do you have installed? Which vips-php-ext version?

Are you on a Admin-Panel aswell? If so which? Plesk? cPanel?

christophlehmann commented 4 years ago

I use

Mac PHP 7.2.2 TYPO3 9.5.9 Vips PHP Module 8.8.4 Vips TYPO3 Extension @ dev-master =>

cd typo3conf/ext/
git clone https://github.com/christophlehmann/vips.git
cd vips
composer remove --no-update typo3/cms-core
composer install
=> Install vips extension
cd typo3conf
echo "
<?php
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Lemming']['Vips']['writerConfiguration'] = [
    \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
        \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
            'logFileInfix' => 'vips'
        ]
    ]
];
"  > AdditionalConfiguration.php

Do you missed to add <?php in the beginning of AdditionalConfiguration.php ? Imo this must be the reason for your broken backend..

the-hotmann commented 4 years ago

Do you missed to add <?php in the beginning of AdditionalConfiguration.php ? Imo this must be the reason for your broken backend..

Yes it wasnt there befor, my bad just copied and did not think about.

Now debugging is working: VipsOperation: class "thumbnail_image" not found The Log contains this:

Sat, 28 Dec 2019 19:20:17 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":2560,"maxHeight":null,"crop":null,"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:17 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":1920,"maxHeight":null,"crop":null,"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:18 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":1200,"maxHeight":null,"crop":{},"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:18 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":992,"maxHeight":null,"crop":{},"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:18 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":768,"maxHeight":null,"crop":{},"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:19 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":480,"maxHeight":null,"crop":{},"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:19 +0000 [INFO] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Unsupported: fileadmin/user_upload/praxis_header_1920.jpg Fallback to TYPO3 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":2560,"maxHeight":null,"crop":null}
Sat, 28 Dec 2019 19:20:19 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/img/a/Ingrid.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":null,"maxHeight":null,"crop":null,"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:19 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/img/a/Roland.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":null,"maxHeight":null,"crop":null,"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:19 +0000 [CRITICAL] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/img/a/Julia.jpg. Got "VipsOperation: class "thumbnail_image" not found
" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":null,"maxHeight":null,"crop":null,"fileExtension":"jpg"}

I cut off the error related to "SVG" as this is not part of the default file types

The line:

" in /var/www/vhosts/domain.de/httpdocs/typo3/typo3conf/ext/vips/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":480,"maxHeight":null,"crop":{},"fileExtension":"jpg"}
Sat, 28 Dec 2019 19:20:19 +0000 [INFO] request="701880a1a6f49" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Unsupported: fileadmin/user_upload/praxis_header_1920.jpg Fallback to TYPO3 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":2560,"maxHeight":null,"crop":null}

seems to be strange sopmehow, as it just do have maxWidth and nothing else.

PHP 7.2.2

May I should mention I'm running on PHP 7.4.1

If I may say this: it would be nice to be able to activate/deactivate Debug with a checkbox in the ExtensionSettings or if it gets activated when TYPO3 is in Debug Mode.

I think there are actually 2 problems:

  1. vips can somehow not process the Images
  2. when it is not able to process the Fallback is not working, as if vips fails the pictures are not getting processed from native TYPO3 ImageProcessor
christophlehmann commented 4 years ago

Now debugging is working: VipsOperation: class "thumbnail_image" not found

Great! Found this: https://github.com/libvips/ruby-vips/issues/192 Maybe some related...

I used thumbnail_image() not to have an intermediate save/open step. Maybe we should do it like this

=> crop() => save() to temp file => thumbnail() => save() to final file

I will try to fix it tomorrow and test it with a new ubuntu.

the-hotmann commented 4 years ago

Yes and this:

Hello @dkam, Ubuntu 18.04 unfortunately bundles a very old libvips (8.4 I think? from 2016) also matches my libvips version (8.4.5) which is the one that gets installed on Debian 9..

Maybe Debian 10 will have a newer one. (checked it Debian 10 gets bundled with 8.7, not to new but better then 8.4) Maybe you can even differenciate between the versions.

If 8.4 gets used:

=> crop()
=> save() to temp file
=> thumbnail()
=> save() to final file
=> delete() from temp file

(with "temp file" do you mean to save it to "typo3temp" or in Memory?

And is vips able to do two operations without having to save to memory?)

Like this I mean:

=> crop() => thumbnail()
=> save() to final file

or like this:

=> crop(thumbnail())
=> save() to final file

If newer version gets used:

=> thumbnail_image()
=> save() to final file

But you wuld have to reach out to @jcupitt to ask him in which version this got resolved. Also the vips extension should have like a minimum required libvips version.

But again, this just solves one from these two issues. vips then may be able to generate Files, but the Fallback is still not working.

jcupitt commented 4 years ago

Hello, this is a very cool extension!

You should always thumbnail first. thumbnail combines load and resize in one operation, so it can exploit features like resize on load in the image load library. You'll see a huge speedup for formats like JPG, PDF, WEBP and SVG.

I would only use thumbnail_image if you really have to -- it can't do any of these resize-on-load tricks. Use thumbnail or thumbnail_buffer instead.

Yes, libvips can combine any number of operations without saving to memory. Just chain them together and they'll join up to make a pipeline.

jcupitt commented 4 years ago

For example, with a 10k a 10k JPG on this laptop:

john@kiwi:~/pics$ time vips thumbnail_image wtc.jpg x.jpg 128

real    0m1.652s
user    0m0.966s
sys 0m0.449s
john@kiwi:~/pics$ time vips thumbnail wtc.jpg x.jpg 128

real    0m0.350s
user    0m0.333s
sys 0m0.016s
the-hotmann commented 4 years ago

Damn, the big master made his way here. You shall be blessed! Thanks for the explanation. I hope @christophlehmann can do something with that.

Is there anything else that have to be considered when using libvips v8.4.5 (Debian v9.11)? And will newer versions of libvips be available for Debian 9 in the future aswell?

the-hotmann commented 4 years ago

@jcupitt as you are already here allow me to ask some more questions:

  1. is there a way to choose a different encoding? Like to force "progressive encoding" or even "semi-progressive encoding" even if the original File was not encoded this way ezgif com-video-to-gif (2) I ask for this, as progressiv encoded files are smaller as non-progressiv encoded files and they also load faster/smoother, specially semi-progressive are very nice as they do not have strange blurrs when they load.
  2. When processing a image (eg resizing) will it keep its metadata? If metadatas are not needed how to stripe them away to make the file smaller? (we dont need metadata in images in the web)
  3. is there a difference when it comes to quality compared to IM, GM, GD for converting?

Example: image1.jpg --> image1.webp (at 100% quality and lossless)

When this is done with vips does the image have the same visible quality compared to, if done with ImageMagick? And what about ImageSize?

Does vips contain parameters to set to get the smallest file possible? (by respecting the given quality parameter?)

Sorry if these questions are dumb/noob questions, I'm new to this

jcupitt commented 4 years ago

Hello @MartinH0,

  1. You can set progressive (sometimes called interlace) mode in the same options, eg. vips copy x.png y.jpg[interlace]. You can see all the same options for a format with eg. vips jpegsave.

  2. libvips always loads and preserves all the metadata it can. You can see all metadata with eg. vipsheader -a x.jpg. You can remove specific items of metadata with remove, or block the save of all metadata with strip, eg. vips copy x.jpg y.png[strip].

  3. Quality should be at least roughly equivalent, though there are probably some small differences in defaults or the interpretation of parameters.

  4. No, there's no automatic search-for-settings-that-minimise-file-size feature, but for most images and formats it's pretty obvious.

christophlehmann commented 4 years ago

You should always thumbnail first. The thumbnail operations combine load and resize in one operation, so they can exploit features like resize on load in the image load library. You'll see a huge speedup for formats like JPG, PDF, WEBP and SVG.

I would only use thumbnail_image if you really have to -- it can't do any of these save-on-load tricks. Use thumbnail or thumbnail_buffer instead.

Yes, libvips can combine any number of operations without saving to memory. Just chain them together and they'll join up to make a pipeline.

Hey @jcupitt,

thanks for all your input! I will adapt the code

christophlehmann commented 4 years ago

I installed vips via pecl on Ubuntu 18.04 and thumbnail() seems to be no alternative for vips 8.4.5

Fri, 03 Jan 2020 22:24:20 +0100 [CRITICAL] request="9648aedfb8acb" component="Lemming.Vips.Resource.Processing.PreviewHelper": Failed to process .../fileadmin/helloquence-5fNmWej4tAA-unsplash.jpg. Got "VipsOperation: class "thumbnail" not found
jcupitt commented 4 years ago

thumbnail was added in 8.5, back in 2016. It took Debian a while to package it, unfortunately, there was a change of maintainer.

I made a dockerfile that builds libvips stable for ubuntu 16.04:

https://github.com/jcupitt/docker-builds/blob/master/php-vips-ubuntu-16.04/Dockerfile

FaraFara commented 4 years ago

VIPS typo3 Extension from master branch.

vips-8.8.2-Fri Aug 30 10:03:37 UTC 2019

vips property value
Vips headers version 8.8.2
Vips library version 8.8.2
Vips ABI version 53.1.11
Major version 8
Minor version 8
Micro version 2
Cache max mem 104857600
Cache max operations 1000
Cache current operations 1000
Cache max open files 100
Concurrency 3
SIMD support with liborc no
JPEG support yes
PNG support yes
TIFF support no
GIF support no
OpenEXR support no
load OpenSlide no
load Matlab no
load PDF no
load SVG yes
FITS support no
WebP support yes
HEIF support no
load with libMagick no
Text rendering support yes
ICC profile support with lcms no

Got this error in log:

Sat, 04 Jan 2020 11:58:46 +0300 [CRITICAL] request="b9a394cd739b7" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /home/klassikark/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_4062.JPG. Got "vips__file_open_write: unable to open file "IMG_4062_594_ecdb2baf07.jpg" for writing unix error: Permission denied " in /home/klassikark/webdata/new/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":557,"maxHeight":null,"crop":{},"fileExtension":"jpg"}

Standard GM works fine

jcupitt commented 4 years ago
unable to open file "IMG_4062_594_ecdb2baf07.jpg" for writing

It looks like you've passed a relative filename to write. That will try to write to the directory the PHP process is running in, which is probably read-only.

I would always pass full paths to write.

christophlehmann commented 4 years ago

@FaraFara

Got "vips__file_open_write: unable to open file "IMG_4062_594_ecdb2baf07.jpg" for writing unix error: Permission denied "

You should check your file permissions

christophlehmann commented 4 years ago

I would always pass full paths to write.

I will have a look at it

FaraFara commented 4 years ago

@FaraFara

Got "vips__file_open_write: unable to open file "IMG_4062_594_ecdb2baf07.jpg" for writing unix error: Permission denied "

You should check your file permissions

It's not about permissions. GraphickMagick work fine.

FaraFara commented 4 years ago

Well done. This patch is work. +15-20% perfomance VS GraphicsMagick 1.3.33 on my tests.

FaraFara commented 4 years ago

For remove TYPO3 deprecation warnings, may be refactor some code? :) Снимок экрана 2020-01-04 в 23 50 30

christophlehmann commented 4 years ago

+15-20% perfomance VS GraphicsMagick 1.3.33 on my tests. The performance gain really depends on image size, tasks to perform, etc.

One of my tests was

Testimage: https://unsplash.com/photos/5fNmWej4tAA Tasks: crop & scale Result: Normal request time: 300ms Request time with thumbnail generation (vips 8.8.4): 500-600ms => 200ms Request time with thumbnail generation (gm 1.3.31): 1s+ => 700ms

Seems okay for the moment. John suggests thumbnail => crop, currently it's crop => thumbnail. I will try to implement it, but later.

For now it's more important to implement the correct handling of upscaling and cropping by parameters like height:100c to make it production ready, see Readme.

For remove TYPO3 deprecation warnings, may be refactor some code? :) The things are needed to support TYPO3 8.7 and will be dropped soon ;-) Sadly there is no (or i don't know) a possibility to whitelist such parts for extension scanner.

I released 0.03 to TER

the-hotmann commented 4 years ago

was added in 8.5, back in 2016. It took Debian a while to package it, unfortunately, there was a change of maintainer.

@jcupitt is there a way to get v+8.5 on Debian 9? I'm currently working a lot on Debian 8/9/10.. But libvips is always outdated here.

Debian 8: 7.40.6-2

Debian 9: 8.4.5-1

Debian 10: 8.7.4-1

Would love to see some newer versions on at least Debian 9 & 10. Who do I have to contact to probably ask for this?

EDIT:

Failed to process /var/www/vhosts/domain.de/httpdocs/typo3/fileadmin/user_upload/praxis_header_1920.jpg. Got "VipsOperation: class "thumbnail_buffer" not found.

As I run on Debian 9 (vips 8.4.5) this seems not to support the class "thumbnail_buffer" Means for me the Images are still not getting processed.

In the Log is also written: Sat, 04 Jan 2020 23:58:35 +0000 [INFO] request="6b59f0898bf19" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Unsupported: fileadmin/user_upload/praxis_header_1920.jpg Fallback to TYPO3 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":2560,"maxHeight":null,"crop":null}

But its not falling back to TYPO3 standard. Images are not getting processed at all if vips fails.

jcupitt commented 4 years ago

I would deploy on deb9 with docker:

https://github.com/jcupitt/docker-builds/blob/master/php-vips-debian9/Dockerfile

FaraFara commented 4 years ago

Seems okay for the moment. John suggests thumbnail => crop, currently it's crop => thumbnail. I will try to implement it, but later.

@jcupitt post new libvips version: 8.9.0. New version is more speed up. How about implementing these features (thumbnail => crop) for even more perfomance?

christophlehmann commented 4 years ago

I'm going to implement Thumbnail -> Crop. Spare time is rare atm :/

FaraFara commented 4 years ago

I'm going to implement Thumbnail -> Crop. Spare time is rare atm :/

Latest version don't work on crop. Log: Wed, 22 Jan 2020 09:29:10 +0300 [DEBUG] request="a0efc1df1ec7d" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": thumbnail croparea /home/klassikark/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG - [414.99999999999994,311.25] Wed, 22 Jan 2020 09:29:10 +0300 [DEBUG] request="a0efc1df1ec7d" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": crop croparea /home/klassikark/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG - {"offsetX":0,"offsetY":38.595,"width":415,"height":312} Wed, 22 Jan 2020 09:29:10 +0300 [CRITICAL] request="a0efc1df1ec7d" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /home/klassikark/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG. Got "extract_area: bad extract area " in /home/klassikark/webdata/new/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":415,"maxHeight":null,"crop":{},"fileExtension":"jpg"}

christophlehmann commented 4 years ago

Thanks for testing. Seems to be the missing pixel (415 <=> 414.99999999999994). I will fix it.

FaraFara commented 4 years ago

Nothing changed. Log: Thu, 23 Jan 2020 09:04:51 +0300 [DEBUG] request="d08a006300f9e" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": thumbnail croparea /home/klassika rk/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG - [415,312,[0,38.595,415,312]] Thu, 23 Jan 2020 09:04:51 +0300 [DEBUG] request="d08a006300f9e" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": crop croparea /home/klassikark/we bdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG - [[0,38.595,415,312],415,311] Thu, 23 Jan 2020 09:04:51 +0300 [CRITICAL] request="d08a006300f9e" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Failed to process /home/klassi kark/webdata/new/web/fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG. Got "extract_area: bad extract area " in /home/klassikark/webdata/new/vendor/jcupitt/vips/src/Image.php:778 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":415,"maxHeight":n ull,"crop":{},"fileExtension":"jpg"}

After refresh page, TYPO3 fallback: Thu, 23 Jan 2020 09:05:00 +0300 [INFO] request="91cbdac3d3ca7" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Unsupported: fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG Fallback to TYPO3 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":557,"maxHeight":null,"crop":{}} Thu, 23 Jan 2020 09:05:00 +0300 [INFO] request="91cbdac3d3ca7" component="Lemming.Vips.Resource.Processing.CropScaleMaskHelper": Unsupported: fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG Fallback to TYPO3 - {"width":null,"height":null,"minWidth":null,"minHeight":null,"maxWidth":415,"maxHeight":null,"crop":{}}

the-hotmann commented 4 years ago

Nothing changed. `Unsupported: fileadmin/Katalog_uslug/Biznes_i_promo-suveniry/Kruzhki_s_foto/IMG_5071.JPG Fallback to TYPO3 -

This actually means it cant process the JPG why ever. But how you say:

Nothing changed.

?

It changed from Got "extract_area: bad extract area " to Fallback to TYPO3

FaraFara commented 4 years ago

On this commit all works fine: 489ffb9fd767ecc2f36550a65e2870080713fc35 After is broken..... Test enviroment is not changed