![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2023
Device: Kindle Paperwhite 11th
|
News sources images getting resized
Hi. I was trying to fix a .recipe file that was getting small images in my kindle paperwhite. So I made a new function so it downloads the biggest size. Then added some img css so it used the full width. But it didn't work. When I converted the .mobi file to .epub I noticed that all the images had some custom css:
Code:
.calibre_13 { height: 222px; vertical-align: baseline; width: 414px; } .calibre_14 { height: 252px; vertical-align: baseline; width: 414px; } .calibre_15 { height: 240px; vertical-align: baseline; width: 414px; } Thank you. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,185
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no 414 in calibre, its coming from the source html/css
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2023
Device: Kindle Paperwhite 11th
|
You're right, I was looking at the css but it seems that comes from the html.
Any idea on how to parse that from the source? The website looks like this: Code:
<img height="0" width="414" src=""> Code:
<img src=""> Code:
def postprocess_html(self, soup, first_fetch): while len(soup.find_all('width')) > 0: soup.width.extract() while len(soup.find_all('height')) > 0: soup.height.extract() return soup |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,185
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just add remove_attributes = ['width']
to the recipe |
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Feb 2023
Device: Kindle Paperwhite 11th
|
Thank you!
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Limit images to be resized | rubeus | Plugins | 3 | 12-06-2015 12:58 PM |
Automatic news fetch: different news sources to different Kindles? | kcp | Calibre | 4 | 01-24-2015 02:43 PM |
News Sources | sisterphonetica | Recipes | 5 | 06-27-2014 11:30 AM |
[Enhancement] Add new news sources of ABC NEWS | donnie888 | Recipes | 0 | 12-23-2012 12:39 AM |