humanmade / S3-Uploads

The WordPress Plugin to Store Uploads on Amazon S3
1.95k stars 391 forks source link

No thumbnails are being generated when certain Wordpress theme is active #171

Open mhennessie opened 7 years ago

mhennessie commented 7 years ago

I am running WordPress on an EC2 instance with PHP 7 and Wordpress works fine until I activate the plugin. Then it stops producing the various size images like it normally does (thumb, med, large). I am positive that image magick is installed so that is not the issue. When I disable the plugin, Wordpress uploads then function normally and generate the different size images. Any help is appreciated.

mhennessie commented 7 years ago

So it appears something on my server is causing it not to work. I spun up a new instance and it works fine there. Wish I could figure out what is causing the problems.

mhennessie commented 7 years ago

I have narrowed this down to a conflict with the theme. What that conflict is, I have no idea. This is a widely used Wordpress theme that I use as a starting point a lot so I need to figure this out.

myylow commented 7 years ago

I have the same issue - thumbnails work fine with S3-Uploads deactivated, but with it on only the fullsize image gets uploaded.

Turns out it needed both GD enabled AND Imagick disabled in order for the thumbnails to be created and uploaded. Not sure if this counts a bug or not? But I guess so, as the thumbnail creation with Imagick worked when the plugin was deactivated.

(It's a great plugin otherwise though!)

mhennessie commented 7 years ago

I will have to try installing both. I tried it with each of them installed individually but never together. Id love to be able to use this plugin.

myylow commented 7 years ago

The only way that worked for me was when phpinfo showed GD enabled but Imagick disabled. I guess it's some conflict with Imagick, or a specific version of it.

If you're using Docker, this image worked for me (after adding php7-mysqli to the list of extensions).

rmccue commented 7 years ago

We dug into this to see if there was anything obvious; the only thing we could see was getimagesize being used, but as PHP's docs note, this is available even without GD. We can probably dig into whether GD is actually required, but in the meantime, it might just be better to install GD to solve the problems. :)

mhennessie commented 7 years ago

For me, I tried both ImageMagick and GD, not together though, and the result was the same with the theme I was using. As soon as I switched to one of the default Wordpress themes then the plugin started working as it should with either ImageMagick or GD.

etherealite commented 7 years ago

@mike-low I've tried to use the image you referenced a few days ago:

If you're using Docker, this image worked for me (after adding php7-mysqli to the list of extensions).

However when you go into wp-admin, WordPress complains that it is unable contact wordpress.org for updates. I tried to perform a simple Curl request to google.com, wordpress.org etc in a separate script and PHP Curl threw an error saying that the 'name lookup timed out'.

It has something to do with the way Musl Libc screws up DNS name lookups. Are you aware of a fix for this?

mwcbrent commented 6 years ago

Your theme does need to have add_theme_support( 'post-thumbnails' ); which I believe is best called in the after_setup_theme hook.

yassinekharchaf commented 5 years ago

after_theme_setup

I think the hook is after_setup_theme and not after_theme_setup

haozhou commented 5 years ago

Update: After installing php73-pecl-imagick-im7-3.4.3_5, the thumbnails are created successfully. That's the solution for me.


I had same issue with Wordpress theme "Twenty Eleven"

  1. I use latest code from master
  2. add_theme_support( 'post-thumbnails' ) is present in Theme functions.

Steps to reproduce:

  1. Upload new image in Medial libray
  2. Check S3 bucket by executing wp s3-uploads ls and found only the original picture is uploaded but not the thumbnails
  3. The preview image in the media library is default grey image-like image which means the thumbnail does not exist.

This makes the image management really difficult without the previewing of the thumbnails. Is there a solution?

Thanks