studioespresso / craft3-seeder

Seeder is the easiest way to quickly create placeholder content while you're building out a website. Create your sections & fields and then let Seeder make entries for you.
https://plugins.craftcms.com/seeder
MIT License
28 stars 3 forks source link

Random image generation #2

Closed jan-dh closed 6 years ago

jan-dh commented 6 years ago

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 commented 6 years ago

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

janhenckens commented 6 years ago

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 commented 6 years ago

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

jan-dh commented 6 years ago

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 commented 6 years ago

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

jan-dh commented 6 years ago

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

janhenckens commented 6 years ago

Fixed in 1.0.2, just pushed that update!

belkin commented 4 years ago

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 commented 3 years ago

@belkin seems to be related to this Faker issue: https://github.com/fzaninotto/Faker/issues/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 commented 3 years ago

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