ImageCropper

ImageCropper is used to extract a certain part of an image to create a new image.

<h:form>
    <p:growl id="msgs" showDetail="true"/>
    
    <h:panelGrid columns="2">
        <p:imageCropper value="#{cropperView.croppedImage}" image="/resources/demo/images/nature/nature6.jpg" initialCoords="225,75,300,125"/>
        <h:panelGroup id="cropped">
            <p:graphicImage rendered="#{not empty cropperView.newImageName}" name="demo/images/crop/#{cropperView.newImageName}.jpg" />
        </h:panelGroup>
    </h:panelGrid>

    <p:commandButton value="Crop" action="#{cropperView.crop}" update="cropped msgs" icon="pi pi-clone"/>
</h:form>