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

Incorrect behavior of faker.image functions #556

Closed
JoCat opened this issue Feb 24, 2022 · 11 comments
Closed

Incorrect behavior of faker.image functions #556

JoCat opened this issue Feb 24, 2022 · 11 comments
Assignees
Labels
c: bug Something isn't working p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug

Comments

@JoCat
Copy link
Contributor

JoCat commented Feb 24, 2022

Describe the bug

Some image functions associated with the placeimg.com service do not work due to the fact that the service has abolished some image categories.

example:

faker.image.abstract()
faker.image.business()
faker.image.cats()
faker.image.city() // replace link to arch
faker.image.fashion()
faker.image.food()
faker.image.nightlife()
faker.image.sports()
faker.image.technics() // replace link to tech
faker.image.transport()

maybe you should also check related function faker.image.image()

list of current categories taken from placeimg.com:
image

Reproduction

https://stackblitz.com/edit/faker-js-demo-bbhemk?file=index.ts

Additional Info

No response

@JoCat JoCat added the s: pending triage Pending Triage label Feb 24, 2022
@ST-DDT
Copy link
Member

ST-DDT commented Feb 24, 2022

There are other categories that aren't working either e.g. cats.

@ST-DDT ST-DDT added c: bug Something isn't working p: 2-high Fix main branch and removed s: pending triage Pending Triage labels Feb 24, 2022
@ST-DDT ST-DDT moved this to Todo in Faker Roadmap Feb 24, 2022
@Shinigami92
Copy link
Member

There are other categories that aren't working either e.g. cats.

@franznoel
Copy link

So, do we have other alternative sources? or are we going to remove the non-existing ones?

@JoCat
Copy link
Contributor Author

JoCat commented Feb 26, 2022

In principle, there are enough services on the Internet for obtaining images. It remains only to choose normal

@Shinigami92
Copy link
Member

I'm not yet sure if we want to just provide more and more alternative services, or if we may want to provide a helper/factory functionality to just provide an image provider yourself but have a defined way of getting the random images.
That way you could easily swap in and out an image provider 🤔

@ST-DDT should we count this as v6.1 bug fix? or is it really needed right now in v6.0 and holding us back to release a v6.0.0?
I think and assume this issue is also present in v5.5.3 also 🤔

@ST-DDT
Copy link
Member

ST-DDT commented Feb 26, 2022

The links are working (although the show wrong content). removing the methods would be more breaking.
Thus I agree with moving this to v6.1.

@JoCat
Copy link
Contributor Author

JoCat commented Feb 28, 2022

faker.image.cats() maybe raplaced to https://placekitten.com/

there is also: https://loremflickr.com/
it looks like it has a selection by categories

there is also https://picsum.photos/ but there seems to be no selection by category

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent and removed p: 2-high Fix main branch labels Mar 15, 2022
@Shinigami92
Copy link
Member

IMO this is a bigger issue to tackle, so unless someone wants to propose a PR that somehow easily fix this, I would like to move this into v7+ and rethink about the whole image provider structure.
So now we can fix and release soon the v6.1 bug fixes and move on to v6.2.

@JoCat
Copy link
Contributor Author

JoCat commented Mar 24, 2022

I can try to implement this, only a little later
weekends for example

@JoCat
Copy link
Contributor Author

JoCat commented Mar 27, 2022

rethink about the whole image provider structure

Yes, I think it won't hurt

by the way, I noticed that there are other image providers in the code. But the site is the same lorempixel.com does not work

@Shinigami92 Shinigami92 moved this from Todo to Awaiting Review in Faker Roadmap Mar 27, 2022
@Shinigami92 Shinigami92 added the s: accepted Accepted feature / Confirmed bug label Mar 27, 2022
@damienwebdev
Copy link
Member

I think this can be closed. There's a much larger project here which is to decide upon a FakeImageProvider interface that has externally provided options with a sane default. This would allow us to mitigate these kinds of problems. When we begin that process, I'll open a new issue and link it from here.

Repository owner moved this from Awaiting Review to Done in Faker Roadmap Apr 1, 2022
@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

No branches or pull requests

5 participants