static public Pixbuf LoadAtMaxSize(string path, int max_width, int max_height) { #if true PixbufUtils.AspectLoader loader = new AspectLoader(max_width, max_height); return(loader.LoadFromFile(path)); #else int width, height; JpegUtils.GetSize(path, out width, out height); PixbufUtils.Fit(width, height, max_width, max_height, false, out width, out height); Gdk.Pixbuf image = JpegUtils.LoadScaled(path, width, height); return(image); #endif }
public ImageInfo(ImageFile img) { // FIXME We use the memory store to hold the anonymous statements // as they are added so that we can query for them later to // resolve anonymous nodes. store = new MemoryStore(); if (img == null) { return; } if (img is StatementSource) { SemWeb.StatementSource source = (SemWeb.StatementSource)img; source.Select(this); // If we couldn't find the ISO speed because of the ordering // search the memory store for the values if (iso_speed == null && iso_anon != null) { add = false; store.Select(this); } } if (img is JpegFile) { int real_width; int real_height; JpegUtils.GetSize(img.Uri.LocalPath, out real_width, out real_height); width = real_width.ToString(); height = real_height.ToString(); } #if USE_EXIF_DATE date = img.Date.ToLocalTime(); #endif }