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.
Skriv kommentar
Kategorier
- SharePoint 2 inlägg
- ImageVault 19 inlägg
- EPiServer 20 inlägg
- ProcessMap 2 inlägg
- EmailEncoder 1 inlägg
Arkiv
- mars 2010 2 inlägg
- april 2010 1 inlägg
- maj 2010 1 inlägg
- juni 2010 1 inlägg
- januari 2011 4 inlägg
- februari 2011 1 inlägg
- mars 2011 1 inlägg
- maj 2011 2 inlägg
- juli 2011 3 inlägg
- augusti 2011 1 inlägg
- september 2011 1 inlägg
- januari 2012 2 inlägg
- mars 2012 1 inlägg
- juni 2012 1 inlägg


Diskussion