Width and height of an image
When using ImageVault it is easy to get a image in any format and size you like using the API. Though in some circumstances it's not easy to determine the exact width and height of the result. For instance if you have only specified the width. And the editors also have their chance to get creative using the image editor to make adjustments to images.
Currently it's not possible to get this information using the API, but it is easily done if you are prepared to get under the hood.
<%@ Import Namespace="ImageStoreNET.Classes.Handlers" %> <%@ Import Namespace="ImageStoreNET.Classes.Data" %> <% FileWrapper fw = ImageHandler. ParseUrlAndGetImage(CurrentPage["IVImage"].ToString()); DataObjectFormatInformation info = DataFactory.Instance.ImageConverter. LoadDataObjectFormatInformation(fw.File.FullName); %> Filename = <%=fw.File.FullName%> <br /> Width = <%=info.Width%> <br /> Height = <%=info.Height %> <br />
In the example above I have a ImageVaultImage-property called IVImage which is used to get the url to the image, though any url to an ImageVault image would do.
Also note that the FileWrapper contains a DataObject which contains information about the image. But the information in any DataObject or IVDataObject is always about the original file so don't get fooled.
Leave a comment
Categories
- SharePoint 2 posts
- ImageVault 15 posts
- EPiServer 16 posts
- ProcessMap 2 posts
- EmailEncoder 1 posts
Archive
- March 2010 2 posts
- April 2010 1 posts
- May 2010 1 posts
- February 2011 3 posts
- April 2011 1 posts
- March 2011 1 posts
- May 2011 2 posts
- July 2011 2 posts
- August 2011 1 posts
- September 2011 1 posts
- January 2012 2 posts
- March 2012 1 posts


Discussion