diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 2ca3bb0c54..0a3945304a 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -37,6 +37,8 @@ class Plugin(_Plugin): self.fsizes.append((name, num, float(size))) self.fnames = dict((name, sz) for name, _, sz in self.fsizes if name) self.fnums = dict((num, sz) for _, num, sz in self.fsizes if num) + self.width_pts = self.width * 72./self.dpi + self.height_pts = self.height * 72./self.dpi # Input profiles {{{ class InputProfile(Plugin): diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 84bce3864e..6c0c384eb3 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -575,7 +575,7 @@ class Style(object): if parent is not None: base = parent.width else: - base = self._profile.width + base = self._profile.width_pts if 'width' in self._element.attrib: width = self._element.attrib['width'] elif 'width' in self._style: @@ -605,7 +605,7 @@ class Style(object): if parent is not None: base = parent.height else: - base = self._profile.height + base = self._profile.height_pts if 'height' in self._element.attrib: height = self._element.attrib['height'] elif 'height' in self._style: