Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebP and PNG thumbnails generated in root folder with IM driver #4178

Closed
theamnesic opened this issue Feb 24, 2022 · 10 comments
Closed

WebP and PNG thumbnails generated in root folder with IM driver #4178

theamnesic opened this issue Feb 24, 2022 · 10 comments

Comments

@theamnesic
Copy link

theamnesic commented Feb 24, 2022

Description

Randomly, webp thumbs are generated in the root folder with a double .webp extension.

Expected behavior
Thumbs in media folder, not root.

Screenshots
kirby-github

To reproduce

Set this 'srcset' in config, with im driver:


'thumbs' => [

	'driver' => 'im',

	'srcsets' => [

		'default' => [
			'480w' =>  ['width' => 480,  'quality' => 78],
			'768w' =>  ['width' => 768,  'quality' => 78],
			'1024w' => ['width' => 1024, 'quality' => 78],
			'1440w' => ['width' => 1440, 'quality' => 78],
			'1920w' => ['width' => 1920, 'quality' => 78],
			'2048w' => ['width' => 2048, 'quality' => 78]
		], 

		'webp' => [
			'480w'  => ['width' => 480,  'quality' => 90, 'format' => 'webp'],
			'768w'  => ['width' => 768,  'quality' => 90, 'format' => 'webp'],
			'1024w' => ['width' => 1024, 'quality' => 90, 'format' => 'webp'],
			'1440w' => ['width' => 1440, 'quality' => 90, 'format' => 'webp'],
			'1920w' => ['width' => 1920, 'quality' => 90, 'format' => 'webp'],
			'2048w' => ['width' => 2048, 'quality' => 90, 'format' => 'webp']
		], 
	]
],

Upload multiple images and check your root folder.

Your setup

Kirby Version
3.6.2 - no plugins

Your system (please complete the following information)
Same on my local MAMP on macOS Monterey and my OVH web hosting (PHP 7.4).

Additional context
It seems OK with GD driver. I use IM because of some animated GIFs I need to convert.

@theamnesic
Copy link
Author

A workaround could be use a different driver by preset, for example only for GIFs:
'gif' => ['width' => 100, 'driver' => 'im'].
But this doesn't work...

@theamnesic
Copy link
Author

Update, same root folder generated images with PNGs:

Capture d’écran 2022-03-01 à 13 51 35

Maybe all images with transparency are concerned?

@theamnesic theamnesic changed the title Webp thumbnails generated in root folder with IM driver WebP and PNG thumbnails generated in root folder with IM driver Mar 1, 2022
@distantnative distantnative added the needs: replication 🔬 Requires a sample to reproduce the issue label Mar 8, 2022
@distantnative
Copy link
Member

This definitely will be hard to debug without replication - will see if we can reproduce this somehow. Any other config settings you have?

@HashandSalt
Copy link

HashandSalt commented Mar 12, 2022

I am also seeing this happen on my local Valet using:

PHP 8.0.16
ImageMagick 7.1.0-27
Kirby 3.6.2

Let me inow if i can help at all. My source images are jpegs no transpency involved. I am also using AVIF as well WebP (only seeing AVIF files in the root)

Thumbs config

'thumbs' => [
    'driver' => 'im',
    'bin' => '/opt/homebrew/bin/convert',
    'quality' => 95
],

@HashandSalt
Copy link

Issue still exists, im getting it in another project now, using PHP 8.1 and Valet 3. Also updated Imagemagick to current. :(

@HashandSalt
Copy link

HashandSalt commented Apr 7, 2022

Seems its down to the focuscrop plugin. I just pieced my project together bit by bit in a clean starterkit and and happened as soon used FocusCrop. Theres an issue for it:

flokosiol/kirby-focus#65

So i guess this can be closed as its down to the plugin?

@distantnative
Copy link
Member

@theamnesic ate you using that plugin as well?

@HashandSalt
Copy link

HashandSalt commented Apr 7, 2022

Its odd cos the plugin is still using standard thumb(), srcset() and crop() internally so its a bit crazy why this happens.

@theamnesic
Copy link
Author

@theamnesic ate you using that plugin as well?

My mistake, I thought I didn't have any plugin but flokosiol/focus was installed, even if I don't use it.

Anyway, everything works fine now!

@lukasbestle
Copy link
Member

Thanks for your replies. Closing this as the issue is related to the Focus plugin.
Discussion continues at flokosiol/kirby-focus#65.

@lukasbestle lukasbestle removed the needs: replication 🔬 Requires a sample to reproduce the issue label Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants