Image cropper example

Default

How it looks (preview)

The image you selected has been automatically resized to fit on GOV.UK. If you have JavaScript enabled in your browser you will be able to manually crop and resize the image.

Larry the cat

The part you select will be resized for GOV.UK. The shape is fixed.

Larry the cat

How to call this example

<%= render "components/image_cropper", {
  src: "https://assets.publishing.service.gov.uk/government/assets/history/buildings/larry-the-cat-a47549e08bdbc6cd0e3e042eea943f65b7a4590d95642586e51acb44bb2dcea2.jpg",
  no_js_src: "https://assets.publishing.service.gov.uk/government/assets/history/buildings/larry-the-cat-a47549e08bdbc6cd0e3e042eea943f65b7a4590d95642586e51acb44bb2dcea2.jpg",
  alt_text: "Larry the cat",
  caption: "Larry, Chief Mouser to the Cabinet Office",
  credit: "His Majesty's Government",
  crop_x: 0,
  crop_y: 0,
  crop_width: 400,
  crop_height: 300
} %>