mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
This commit is contained in:
parent
6de21f6c3a
commit
ac64f8029c
@ -893,7 +893,7 @@ class HTMLConverter(object):
|
|||||||
factor = 720./self.profile.dpi
|
factor = 720./self.profile.dpi
|
||||||
|
|
||||||
def scale_image(width, height):
|
def scale_image(width, height):
|
||||||
pt = PersistentTemporaryFile(suffix='.'+encoding.lower())
|
pt = PersistentTemporaryFile(suffix='_html2lrf_scaled_image_.'+encoding.lower())
|
||||||
self.image_memory.append(pt) # Neccessary, trust me ;-)
|
self.image_memory.append(pt) # Neccessary, trust me ;-)
|
||||||
try:
|
try:
|
||||||
im.resize((int(width), int(height)), PILImage.ANTIALIAS).save(pt, encoding)
|
im.resize((int(width), int(height)), PILImage.ANTIALIAS).save(pt, encoding)
|
||||||
@ -931,7 +931,7 @@ class HTMLConverter(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self.autorotation and width > pwidth and width > height:
|
if self.autorotation and width > pwidth and width > height:
|
||||||
pt = PersistentTemporaryFile(suffix='.'+encoding.lower())
|
pt = PersistentTemporaryFile(suffix='_html2lrf_rotated_image_.'+encoding.lower())
|
||||||
try:
|
try:
|
||||||
im = im.rotate(90)
|
im = im.rotate(90)
|
||||||
im.save(pt, encoding)
|
im.save(pt, encoding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user