Getting example images - https://picsum.photos

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting example images - https://picsum.photos

Sven Van Caekenberghe-2
Hi,

This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).

Here is how you can use this from a standard Pharo image (no pun intended).

ZnEasy getJpeg: 'https://picsum.photos/512'.

ImageReadWriter formFromStream: (ZnClient new
  systemPolicy;
  url: 'https://picsum.photos/640/480?grayscale';
  accept: ZnMimeType imagePng;
  get) readStream.

Sven


Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Esteban A. Maringolo
I remember Paul de Bruicker (cc'ed) used a similar service to get user
profiles (with first and last name and pictures, so you can "simulate"
users in your app, and you could ask for male or female profiles).

I don't remember the name, hopefully he will :)

Esteban A. Maringolo

On Mon, Apr 29, 2019 at 8:24 AM Sven Van Caekenberghe <[hidden email]> wrote:

>
> Hi,
>
> This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
>
> Here is how you can use this from a standard Pharo image (no pun intended).
>
> ZnEasy getJpeg: 'https://picsum.photos/512'.
>
> ImageReadWriter formFromStream: (ZnClient new
>   systemPolicy;
>   url: 'https://picsum.photos/640/480?grayscale';
>   accept: ZnMimeType imagePng;
>   get) readStream.
>
> Sven
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Offray Vladimir Luna Cárdenas-2
In reply to this post by Sven Van Caekenberghe-2

Pretty cool!

This is how you get a Pharo image working, with pun intended ;-):

http://ws.stfx.eu/7WN9SG9YBB6E

Cheers,

Offray

On 29/04/19 6:23 a. m., Sven Van Caekenberghe wrote:
Hi,

This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).

Here is how you can use this from a standard Pharo image (no pun intended).

ZnEasy getJpeg: 'https://picsum.photos/512'.

ImageReadWriter formFromStream: (ZnClient new
  systemPolicy;
  url: 'https://picsum.photos/640/480?grayscale';
  accept: ZnMimeType imagePng;
  get) readStream.

Sven



Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Sven Van Caekenberghe-2
Perfect, I should have looked at the list of available images ... great catch.

> On 29 Apr 2019, at 18:42, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>
> Pretty cool!
>
> This is how you get a Pharo image working, with pun intended ;-):
>
> http://ws.stfx.eu/7WN9SG9YBB6E
>
> <hopdbmfikdhjmimg.png>
>
> Cheers,
>
> Offray
>
> On 29/04/19 6:23 a. m., Sven Van Caekenberghe wrote:
>> Hi,
>>
>> This is a cool service:
>> https://picsum.photos
>>  - it gives you example images (pictures/photos).
>>
>> Here is how you can use this from a standard Pharo image (no pun intended).
>>
>> ZnEasy getJpeg: '
>> https://picsum.photos/512
>> '.
>>
>> ImageReadWriter formFromStream: (ZnClient new
>>   systemPolicy;
>>   url: '
>> https://picsum.photos/640/480?grayscale
>> ';
>>   accept: ZnMimeType imagePng;
>>   get) readStream.
>>
>> Sven
>>
>>
>>
>>


Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Paul DeBruicker
In reply to this post by Esteban A. Maringolo
https://uinames.com/ 


The api is a GET e.g.

https://uinames.com/api?region=germany&gender=female


& returns JSON with image url and plausible name among other things.




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Sven Van Caekenberghe-2
Ah, also quite interesting.

With the latest Zn loaded:

Metacello new
  repository: 'github://svenvc/zinc/repository';
  baseline: 'ZincHTTPComponents';
  load.

You can do:

ZnClient new
  systemPolicy;
  forJsonREST;
  url: 'https://uinames.com/api';
  queryAt: #region put: #germany;
  queryAt: #gender put: #female;
  get.

>>> a Dictionary('gender'->'female' 'name'->'Fabienne' 'region'->'Germany' 'surname'->'Schuster' )

> On 29 Apr 2019, at 20:03, Paul DeBruicker <[hidden email]> wrote:
>
> https://uinames.com/ 
>
>
> The api is a GET e.g.
>
> https://uinames.com/api?region=germany&gender=female
>
>
> & returns JSON with image url and plausible name among other things.
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>


Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Paul DeBruicker
I forgot the "ext" query parameter which gives the image urls

so




ZnClient new
  systemPolicy;
  forJsonREST;
  url: 'https://uinames.com/api';
  queryAt: #region put: #germany;
  queryAt: #gender put: #female;
  queryAt:#ext put: nil;
  get.






--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Franz Josef Konrad-2
In reply to this post by Sven Van Caekenberghe-2
Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:

> Hi,
>
> This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
>
> Here is how you can use this from a standard Pharo image (no pun intended).
>
> ZnEasy getJpeg: 'https://picsum.photos/512'.
>
> ImageReadWriter formFromStream: (ZnClient new
>    systemPolicy;
>    url: 'https://picsum.photos/640/480?grayscale';
>    accept: ZnMimeType imagePng;
>    get) readStream.
>
> Sven
>
>

Picsum is listed here <https://github.com/toddmotto/public-apis> along
with a number of other public APIs. Maybe this overview list is
interesting for one or the other.

Franz Josef

Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Guillermo Polito
This makes me remember when I was working doing android mobile apps: there is a kitten placeholder service too. 


And status codes too




:)



On Wed, May 1, 2019 at 10:41 AM Franz Josef Konrad <[hidden email]> wrote:
Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:
> Hi,
>
> This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
>
> Here is how you can use this from a standard Pharo image (no pun intended).
>
> ZnEasy getJpeg: 'https://picsum.photos/512'.
>
> ImageReadWriter formFromStream: (ZnClient new
>    systemPolicy;
>    url: 'https://picsum.photos/640/480?grayscale';
>    accept: ZnMimeType imagePng;
>    get) readStream.
>
> Sven
>
>

Picsum is listed here <https://github.com/toddmotto/public-apis> along
with a number of other public APIs. Maybe this overview list is
interesting for one or the other.

Franz Josef



--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: Getting example images - https://picsum.photos

Sven Van Caekenberghe-2


> On 2 May 2019, at 11:12, Guillermo Polito <[hidden email]> wrote:
>
> This makes me remember when I was working doing android mobile apps: there is a kitten placeholder service too.
>
> https://placekitten.com/
>
> And status codes too
>
> https://http.cat/
>
>
> ZnEasy getJpeg: 'https://placekitten.com/200/300'.
>
> :)

That is obviously better !

> On Wed, May 1, 2019 at 10:41 AM Franz Josef Konrad <[hidden email]> wrote:
> Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:
> > Hi,
> >
> > This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
> >
> > Here is how you can use this from a standard Pharo image (no pun intended).
> >
> > ZnEasy getJpeg: 'https://picsum.photos/512'.
> >
> > ImageReadWriter formFromStream: (ZnClient new
> >    systemPolicy;
> >    url: 'https://picsum.photos/640/480?grayscale';
> >    accept: ZnMimeType imagePng;
> >    get) readStream.
> >
> > Sven
> >
> >
>
> Picsum is listed here <https://github.com/toddmotto/public-apis> along
> with a number of other public APIs. Maybe this overview list is
> interesting for one or the other.
>
> Franz Josef
>
>
>
> --
>    
> Guille Polito
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr
>
> Web: http://guillep.github.io
> Phone: +33 06 52 70 66 13