+
+#if 0
+#warning Angus, could you please adapt this code? (JMarc)
+ if (keepLyXAspectRatio) {
+ // get the imagesize from the cache
+ grfx::Cache & gc = grfx::Cache::get();
+ float const rw = gc.raw_width(filename);
+ float const rh = gc.raw_height(filename);
+ float const ratio = (rw > 0.001) ? rh/rw : 1.0;
+ lyxerr[Debug::GRAPHICS]
+ << "Value of LyXAspectRatio: "
+ << ratio << std::endl;
+ if (!lyxwidth.zero() && !lyxheight.zero()) {
+ if (width < height)
+ height = int(ratio * width);
+ else
+ width = int(ratio * height);
+ } else if (lyxwidth.zero())
+ width = int(ratio * height);
+ else if (lyxheight.zero())
+ height = int(ratio * width);
+ }
+#endif