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

Feature : Add an image faker #25

Open
theredfish opened this issue Sep 12, 2019 · 4 comments
Open

Feature : Add an image faker #25

theredfish opened this issue Sep 12, 2019 · 4 comments

Comments

@theredfish
Copy link

Hello,
What about adding an image faker? We could use this kind of API : http://lorempixel.com/

Let me know if your interested and i will contribute.

@cksac
Copy link
Owner

cksac commented Sep 13, 2019

It will be great to have image faker, but I am not sure is it a good idea to couple with specific image provider. Can you share more about the details? i.e. the faker config and output

@theredfish
Copy link
Author

theredfish commented Sep 14, 2019

The idea behind the image faker is to provide image URLs in order to display them on a website for example or get them through an API call.
Lorempixel is one of fake image providers that offer a way to configure placeholder images.

We can imagine something like that :

let image_url: String = Image(400, 200).fake()
println!("Image url : {}", image_url"); // http://lorempixel.com/400/200/

A PHP library uses lorempixel, you can see the different use cases here : https:/fzaninotto/Faker#fakerproviderimage

Indeed if the image provider stop working one day it will be an issue.

@cksac
Copy link
Owner

cksac commented Sep 16, 2019

If the api is specific to lorempixel, I think the config object can be Lorempixel under image category?
i.e. let image_url: String = Lorempixel(400, 200).fake(), so that we can also implement other image provider when needed.

@theredfish
Copy link
Author

Ok! I will try something like that 👍

@MrRobb MrRobb mentioned this issue Oct 4, 2019
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

2 participants