Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Random image generation #2

Closed
jan-dh opened this issue May 21, 2018 · 10 comments
Closed

Random image generation #2

jan-dh opened this issue May 21, 2018 · 10 comments
Assignees

Comments

@jan-dh
Copy link

jan-dh commented May 21, 2018

When trying to generate random images I get the following error:

Exception 'craft\errors\ImageException' with message 'The file “photo-2145101584.jpg” does not appear to be an image.'

@janhenckens janhenckens self-assigned this May 22, 2018
@janhenckens
Copy link
Member

Yes, noticed this myself over the weekend. Looking into it!

@janhenckens
Copy link
Member

Found the issue!

fzaninotto/faker uses lorempixel.com to get a random image but the larger the image, the slower the response is. I had it set to a 2500x2000 image, which just times out on lorempixel.

Made the image smaller and now it works more reliably. Can you give it another go?

@janhenckens
Copy link
Member

Released an update with this so you'll have to run composer update to pull it down before you try again.

@jan-dh
Copy link
Author

jan-dh commented May 24, 2018

I'm getting this now:

PHP Warning 'yii\base\ErrorException' with message 'rand() expects parameter 2 to be integer, string given'

in .../vendor/studioespresso/craft-seeder/src/services/fields/Fields.php:267

Entry i'm trying to generate has the following fields:
Title, categories, Tags, lightswitch, matrix, related entries

@janhenckens
Copy link
Member

Ai Ai, silly mistake! I’ll have a fix out asap!

@jan-dh
Copy link
Author

jan-dh commented May 24, 2018

You rather have that I create new issues? or shall rename this one in general testing?

@janhenckens
Copy link
Member

Fixed in 1.0.2, just pushed that update!

@belkin
Copy link

belkin commented Jan 13, 2020

I'm getting with the latest version the same mistake

`Exception 'craft\errors\ImageException' with message 'The file “photo-1101246464.jpg” does not appear to be an image.'

in /craftcms/cms/src/image/Raster.php:168`

@drifteaur
Copy link

@belkin seems to be related to this Faker issue: fzaninotto/Faker#2071

Faker is not being developed anymore, and lorempixel - the image generator it was using - seems to be down. You can try using local assets, see the README

@drifteaur
Copy link

@janhenckens using the new faker fork might be the answer? https://github.com/fakerphp/faker

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants