Answers.Body: <p>Try the <a href="https://civicrm.org/extensions/image-resize" rel="nofollow noreferrer">Image Resize Extension</a>:</p>
  <blockquote>
  <p>This extension adds image resize capability to CiviCRM for Contact and Custom Field images. The extension handles resizing of all types of images and will put the images into the cache directory.</p>
  </blockquote>
  <p>Also, an alternative to writing your own roster page from scratch is <a href="https://docs.civicrm.org/user/en/latest/searching/searchkit/what-is-searchkit/" rel="nofollow noreferrer">SearchKit</a> which has this exact feature: you can create a Search Display of type &quot;Grid&quot;, choose the number of columns for your grid and the size of each image in the grid.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-04T16:54:28.250Z
Answers.Text: Awesome, I'll check out SearchKit too.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-01T13:26:53.143Z
Answers.LastActivityDate: 2023-09-03T20:23:30.533Z
Answers.LastEditDate: 2023-09-03T20:23:30.533Z
Answers.UserDisplayName: Coleman
Body: <p>Our organization is a choir with around 60 people.  We've been adding contact photos (using CiviCRM's built-in Contact Image feature) and I've made a roster page where we can see everyone's name &amp; photos, but some of the images are pretty huge (in MB, not necessarily height/width) so the page with images seems to bog down browsers.</p>
  <p>I noticed all the image URLs look like <code>https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg</code>, indicating that this is some kind of dynamic API?  Is there documentation somewhere for it?  Is it capable of resizing to thumbnails or something?  When I do it with just CSS resizing on the fly, it seems like not a great solution.</p>
  <p>I'm generating the roster list using something like this:</p>
  <pre><code>  $api-&gt;Contact-&gt;Get([
      'group' =&gt; $group_list,
      'sequential' =&gt; 1,
      'rowCount' =&gt; 10000,
      'return' =&gt; 'custom_4,display_name,email,phone,street_address,city,state_province,postal_code,id,image_URL',
      'sort' =&gt; 'custom_4,last_name,first_name'
    ]);
  
    $images = array_map( function($c) {
      return $c-&gt;image_URL ? sprintf('&lt;img src=&quot;%s&quot; style=&quot;width: 100px&quot; alt=&quot;Profile image&quot; /&gt;', $c-&gt;image_URL) : '';
    }, $api-&gt;values);
  </code></pre>
  <p>and I'm not sure whether there's any additional info in the API pertaining to the images either.</p>
  <p>I'd love it if I could modify that URL to something like <code>https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg&amp;maxwidth=100</code> or something, is anything like that possible?</p>
  
Tags: <contact-image>
Title: Thumbnail of contact image?
ThreadText: # Thumbnail of contact image?
  
  (Asked by: username_0 on 2023-09-01)
  
  Our organization is a choir with around 60 people.  We've been adding contact photos (using CiviCRM's built-in Contact Image feature) and I've made a roster page where we can see everyone's name & photos, but some of the images are pretty huge (in MB, not necessarily height/width) so the page with images seems to bog down browsers.
  I noticed all the image URLs look like https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg, indicating that this is some kind of dynamic API?  Is there documentation somewhere for it?  Is it capable of resizing to thumbnails or something?  When I do it with just CSS resizing on the fly, it seems like not a great solution.
  I'm generating the roster list using something like this:
    $api->Contact->Get([
      'group' => $group_list,
      'sequential' => 1,
      'rowCount' => 10000,
      'return' => 'custom_4,display_name,email,phone,street_address,city,state_province,postal_code,id,image_URL',
      'sort' => 'custom_4,last_name,first_name'
    ]);
  
    $images = array_map( function($c) {
      return $c->image_URL ? sprintf('', $c->image_URL) : '';
    }, $api->values);
  
  and I'm not sure whether there's any additional info in the API pertaining to the images either.
  I'd love it if I could modify that URL to something like https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg&maxwidth=100 or something, is anything like that possible?
  
  **Tags:** contact-image
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-09-01. Score: 5 | Accepted answer
  
  Try the [Image Resize Extension](https://civicrm.org/extensions/image-resize):
  
  > This extension adds image resize capability to CiviCRM for Contact and Custom Field images. The extension handles resizing of all types of images and will put the images into the cache directory.
  
  Also, an alternative to writing your own roster page from scratch is [SearchKit](https://docs.civicrm.org/user/en/latest/searching/searchkit/what-is-searchkit/) which has this exact feature: you can create a Search Display of type "Grid", choose the number of columns for your grid and the size of each image in the grid.
  
  > **Comments:**
  > **username_0**: Awesome, I'll check out SearchKit too.  
  
  ---
  
  