defsteph / EPiFocalPoint

Focal point based image cropping for EPiServer using ImageResizing.NET
MIT License
9 stars 10 forks source link

Alloy example #5

Closed klavsi closed 7 years ago

klavsi commented 7 years ago

Hi!

Could you, please, commit example based on Alloy?

Thanks!

valdisiljuconoks commented 7 years ago

We had issues getting plugin to work and would love to see sample project with plugin in action. Thanks!

defsteph commented 7 years ago

What are the issues you've been having?

In regards to a sample, there's really not that much to it.

  1. Install Alloy Sample.
  2. Install EPiFocalPoint (it will install the BlobReader and ImageResizer)
  3. Ensure config is correct for ImageResizer, especially the InterceptModule.
  4. Implement the interface IFocalPointData on the ImageData Media Type.
  5. Add the backingtype attribute to the FocalPoint property.

Test by editing an image, go to AllPropertiesView and set a focal point. Open up the image and add parameters that crops the image.

Please note that unless the aspect ratio of the image are changed, the focal point doesn't matter. The purpose of the plugin is to ensure that the focal point is included in crops, not alter how images are cropped in any other way.

valdisiljuconoks commented 7 years ago

What's code snippet for rendering the image? Html.PropertyFor()?

defsteph commented 7 years ago

There's no Html Helper in the package, you can use your helpers from the BlobReader package.

valdisiljuconoks commented 7 years ago

Ok. But how you output the image in your sample? I suspect that BlobReader might shallow crop. I do see only <img src="...image1.jpg?w=150">. I see in code that you modify rewrite defaults. Not sure exactly how that affects IR pipeline thou.

defsteph commented 7 years ago

What do mean by shallow crop?

Also, only passing a width parameter will not change the aspect ratio of your output image, so the focal point won't affect the end result.