ImageCropper

ImageCropper is used to extract a certain part of an image and assign it to a new image value. ImageCropper is capable of both cropping local or external images.

Source

<h:form>
	<h:panelGrid columns="2">
		<p:imageCropper value="#{imageCropperBean.croppedImage}"
                    image="/images/barca/camp_nou.jpg"
                    initialCoords="225,75,300,125"/>
		
		<p:graphicImage id="localCroppedImage"
                    value="barca/#{imageCropperBean.newImageName}.jpg" />
	</h:panelGrid>

    <p:commandButton value="Crop"
                action="#{imageCropperBean.crop}"
                update="localCroppedImage"/>
</h:form>