Prism

Resizing an image

Width or Height

Original image:
http://tryprism-test.s3.amazonaws.com/images/DCM2000.jpg

Giving only width

                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize&w=300">
              

Giving only height

                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize&h=300">
              

Giving both

                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize_then_crop&h=320&w=320">
              

Image Quality

You can change image quality if you want, its 95 default
                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize_then_crop&h=320&w=320&quality=10">
              

Cropping

Resize and crop

We'll first resize to width - for portraits height - then, crop to wanted to height - for portraits width.

                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize&h=140&w=300&resize_then_crop=1">
              

You can crop from topleft too

                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize&h=140&w=300&resize_then_crop=1&gravity=top_left">
              

Retina Devices

You can add retina=1 parameter to the url.
                  <img src="http://test-project.tryprism.com/images/DCM2000.jpg?cmd=resize_then_crop&h=320&w=320&retina=1">
              
This will send 2x image when needed, eg. if your browsers density per pixel ratio is 2
In order this to work, you need to insert this into your webpages.
                      <script type="text/javascript">
                        document.write('<scr' + 'ipt src="http://test-project.tryprism.com/setdpr/'+window.devicePixelRatio+'"></scr' + 'ipt>');
                    >/script>
                  

Non retina