Answers.Body: <p>Testing this it seems that this is simply a quirk of Calibre's ebook viewer. It adds the absolute calculated size of the image dynamically into the source. This size changes when you resize the window (with the <code>inspector</code> window open it shows continuously). Whether <code>max-width</code> and <code>max-height</code> styles are set by the viewer depends on the viewing mode. In <code>page mode</code> (default) these values are set, they seem to be needed for the calculation. In <code>continuous mode</code> your values will not be overridden.</p>
  
  <p>So this is just a quirk of that specific software. You can't change it, you can't draw any conclusions about the behaviour of other software; e.g. my Sony T2 doesn't set own <code>max-width</code> leading to pictures that are not completely visible. In fact I would prefer the intelligent behaviour of Calibre viewer here. FBReader resizes the image to a smaller size to fit it into the width.</p>
  
  <p>Sizes smaller than 100% or the current pixel width can be used without problems, Calibre does not ignore it in either mode. (Absolute pixel widths are obviously a bad idea in any case.)</p>
  
  <p>You can set the values to your needs. As different applications use different heuristics to produce a readable rendering you should stay as close to a semantic markup as possible to be able to ignore such additional output.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-01-14T12:23:28.477Z
Answers.LastActivityDate: 2014-01-14T12:23:28.477Z
Answers.UserDisplayName: his
Body: <p>Under Ubuntu 12.04 I converted with Calibre an <code>html</code> source to <code>epub</code> format, but when I read the resulting <code>epub</code> with Calibre I noticed (using the 'inspect' command of Calibre viewer) that images get some additional styling, absent both in original <code>html</code> and in <code>html</code> that <code>epub</code> is made of. For example,</p>
  
  <pre><code>&lt;img src="copertina_retro.jpg" alt="pict" width="100%"/&gt;
  </code></pre>
  
  <p>in <code>html</code> becomes</p>
  
  <pre><code>&lt;img src="copertina_retro.jpg" alt="pict" width="100%" 
      style="height: 502px; width: 351.91752577319585px; "&gt;
  </code></pre>
  
  <p>inside Calibre viewer, when inspecting the image.
  This prevents me to make manual modifications to the size of a single image.</p>
  
  <p>How can I avoid such 'restyling'?</p>
  
  <p>Does it happen just with Calibre viewer or it is typical behaviour of ebook readers?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-10T19:11:48.347Z
Comments.Text: hello `mmj`, have you tried tex4ebook (https://github.com/michal-h21/tex4ebook ) instead of Calibre? It is based on tex4ht and creates epub or mobi files directly from LaTeX
Comments.UserDisplayName: michal.h21
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-11T08:23:46.873Z
Comments.Text: This style is absent in the epub but visible in the viewer?
Comments.UserDisplayName: his
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-12T09:59:47.007Z
Comments.Text: hi `michal`, didn't know about `tex4ebook` I will surely try it.
Comments.UserDisplayName: mmj
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-12T10:03:38.537Z
Comments.Text: @his. Yes, the 1st line I reported above is from the `epub` source, the 2nd line is the same line as 'inspected' from Calibre viewer.
Comments.UserDisplayName: mmj
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-12T13:37:58.000Z
Comments.Text: So it is just a computed style from that specific viewer software. Why does it prevent you to make manual modifications? Will it be overwritten by this specific value all the time and is the value wrong?
Comments.UserDisplayName: his
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-01-12T16:00:27.470Z
Comments.Text: Exactly, manual modifications to `epub` source are overridden by additional unrequested style. In particular I can't enlarge the size of a specific image.
Comments.UserDisplayName: mmj
Tags: <calibre><image><html>
Title: Avoid additional styling of images in html made by Calibre viewer
UserDisplayName: mmj
ThreadText: # Avoid additional styling of images in html made by Calibre viewer
  
  (Asked by: username_0 on 2014-01-10)
  
  Under Ubuntu 12.04 I converted with Calibre an html source to epub format, but when I read the resulting epub with Calibre I noticed (using the 'inspect' command of Calibre viewer) that images get some additional styling, absent both in original html and in html that epub is made of. For example,
  
  
  in html becomes
  
  
  inside Calibre viewer, when inspecting the image.
  Tusername_2 prevents me to make manual modifications to the size of a single image.
  How can I avoid such 'restyling'?
  Does it happen just with Calibre viewer or it is typical behaviour of ebook readers?
  
  **Tags:** calibre, image, html
  
  > **Comments:**
  > **username_1**: hello `username_0`, have you tried tex4ebook (https://github.com/michal-h21/tex4ebook ) instead of Calibre? It is based on tex4ht and creates epub or mobi files directly from LaTeX  
  > **username_2**: Tusername_2 style is absent in the epub but visible in the viewer?  
  > **username_0**: hi `michal`, didn't know about `tex4ebook` I will surely try it.  
  > **username_0**: @username_2. Yes, the 1st line I reported above is from the `epub` source, the 2nd line is the same line as 'inspected' from Calibre viewer.  
  > **username_2**: So it is just a computed style from that specific viewer software. Why does it prevent you to make manual modifications? Will it be overwritten by tusername_2 specific value all the time and is the value wrong?  
  > **username_0**: Exactly, manual modifications to `epub` source are overridden by additional unrequested style. In particular I can't enlarge the size of a specific image.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-01-14. Score: 2
  
  Testing tusername_2 it seems that tusername_2 is simply a quirk of Calibre's ebook viewer. It adds the absolute calculated size of the image dynamically into the source. Tusername_2 size changes when you resize the window (with the `inspector` window open it shows continuously). Whether `max-width` and `max-height` styles are set by the viewer depends on the viewing mode. In `page mode` (default) these values are set, they seem to be needed for the calculation. In `continuous mode` your values will not be overridden.
  
  So tusername_2 is just a quirk of that specific software. You can't change it, you can't draw any conclusions about the behaviour of other software; e.g. my Sony T2 doesn't set own `max-width` leading to pictures that are not completely visible. In fact I would prefer the intelligent behaviour of Calibre viewer here. FBReader resizes the image to a smaller size to fit it into the width.
  
  Sizes smaller than 100% or the current pixel width can be used without problems, Calibre does not ignore it in either mode. (Absolute pixel widths are obviously a bad idea in any case.)
  
  You can set the values to your needs. As different applications use different heuristics to produce a readable rendering you should stay as close to a semantic markup as possible to be able to ignore such additional output.
  
  
  ---
  
  