out = self.transform(
book.wldocument2() if self.librarian2_api else book.wldocument(),
)
- fieldfile.save(None, File(open(out.get_filename(), 'rb')), save=False)
+ with open(out.get_filename(), 'rb') as f:
+ fieldfile.save(None, File(f), save=False)
self.set_file_permissions(fieldfile)
if book.pk is not None:
book.save(update_fields=[self.attname])
@staticmethod
def transform(wldoc):
- if wldoc.book_info.cover_box_position == 'none':
- from librarian.cover import WLCover
- return WLCover(wldoc.book_info, width=240).output_file()
from librarian.covers.marquise import MarquiseCover
- return MarquiseCover(wldoc.book_info, width=240).output_file()
+ return MarquiseCover(wldoc.book_info, width=360).output_file()
class CoverThumbField(CoverField):