Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Image generation powered by LoremPixel #165

Closed
wants to merge 1 commit into from

Conversation

weotch
Copy link
Contributor

@weotch weotch commented Aug 23, 2013

This adds a new provider for generating images. You can get the remote URL of the image on lorempixel.com or Faker can download the remote image to a directory of your choosing.

@weotch
Copy link
Contributor Author

weotch commented Aug 23, 2013

Adds these formatters:

image($dir)                  // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
image($dir, $width, $height, $category) // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
imageUrl                    // 'http://lorempixel.com/1160/1160/'
imageUrl($width, $height)   // 'http://lorempixel.com/800/600/'
imageUrl($width, $height, $category) // 'http://lorempixel.com/800/600/person/'
personImage($dir)           // '/path/to/dir/13b73edae8443990be1aa8f1a483bc27.jpg'
personImageUrl              // 'http://lorempixel.com/1160/1160/person/'

@fzaninotto
Copy link
Owner

Already discussed in #68, and considered out of Faker's scope. Thanks for your PR, but it won't end up in Faker's master.

@fzaninotto fzaninotto closed this Aug 23, 2013
@Anahkiasen
Copy link

If it comes back regularly like that (#68, #165, #150, #88) shouldn't it end up in Faker's scope ?

@sjelfull
Copy link

sjelfull commented Sep 2, 2013

@fzaninotto: One benefit is the actual downloading of the image, so that you got a manipulable file, instead of just an URL.

Has that been considered?

@fzaninotto
Copy link
Owner

Under public pressure, I'm willing to reconsider my position. I'm reopening this one.

About this PR: I'm not fan of the __callStatic() part. In my opinion, there should be only one way to call the formatters, so you'd better remove it. Also, the code formatting should follow PSR-2, which is not the case yet.

@fzaninotto
Copy link
Owner

Superseded by #193.

@fzaninotto fzaninotto closed this Oct 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants