Compare commits
No commits in common. "e84aa8d42eaa0612318377821ca9c9c37fe21410" and "fab69256741b1b025d305f536941e71e21b9f1e0" have entirely different histories.
e84aa8d42e
...
fab6925674
3 changed files with 8 additions and 17 deletions
|
@ -2,11 +2,6 @@
|
|||
CHANGES
|
||||
=======
|
||||
|
||||
0.5.2 (2024-01-12)
|
||||
------------------
|
||||
|
||||
- support for pymupdf 1.23.0
|
||||
|
||||
0.5.1 (2022-07-23)
|
||||
------------------
|
||||
|
||||
|
|
18
plakativ.py
18
plakativ.py
|
@ -25,11 +25,6 @@ import logging
|
|||
|
||||
have_img2pdf = True
|
||||
try:
|
||||
from PIL import Image
|
||||
|
||||
# ignore PIL limit because this software is meant to create posters which
|
||||
# naturally can be very large in size
|
||||
Image.MAX_IMAGE_PIXELS = None
|
||||
import img2pdf
|
||||
except ImportError:
|
||||
have_img2pdf = False
|
||||
|
@ -51,7 +46,7 @@ except ImportError:
|
|||
tkinter.Menubutton = dummy
|
||||
tkinter.LabelFrame = dummy
|
||||
|
||||
VERSION = "0.5.2"
|
||||
VERSION = "0.5.1"
|
||||
|
||||
PAGE_SIZES = OrderedDict(
|
||||
[
|
||||
|
@ -272,7 +267,7 @@ def complex_cover(n, m, x, y):
|
|||
if X4 > 0 and Y4 > 0:
|
||||
simple_config, (sx, sy) = simple_cover(X4, Y4, x, y)
|
||||
# shift the results such that they are in the center
|
||||
for cx, cy, p in simple_config:
|
||||
for (cx, cy, p) in simple_config:
|
||||
newconfig.append(
|
||||
(
|
||||
w0 * X(r, 0) + (X4 - sx) / 2 + cx,
|
||||
|
@ -286,7 +281,7 @@ def complex_cover(n, m, x, y):
|
|||
if X4 > 0 and Y4 > 0:
|
||||
simple_config, (sx, sy) = simple_cover(X4, Y4, x, y)
|
||||
# shift the results such that they are in the center
|
||||
for cx, cy, p in simple_config:
|
||||
for (cx, cy, p) in simple_config:
|
||||
newconfig.append(
|
||||
(
|
||||
w3 * X(r, 3) + (X4 - sx) / 2 + cx,
|
||||
|
@ -598,7 +593,7 @@ class Plakativ:
|
|||
# the computed positions and storing the largest border size in
|
||||
# each dimension
|
||||
poster_top = poster_right = poster_bottom = poster_left = 0
|
||||
for posx, posy, p in self.layout["positions"]:
|
||||
for (posx, posy, p) in self.layout["positions"]:
|
||||
if p:
|
||||
top = posy - border_top
|
||||
if top < 0 and -top > poster_top:
|
||||
|
@ -1270,7 +1265,7 @@ class Application(tkinter.Frame):
|
|||
|
||||
# draw rectangles
|
||||
# TODO: also draw numbers indicating the page number
|
||||
for x, y, portrait in self.plakativ.layout["positions"]:
|
||||
for (x, y, portrait) in self.plakativ.layout["positions"]:
|
||||
x0 = (x + self.plakativ.layout["posterpos"][0]) * zoom_1 + (
|
||||
self.canvas_size[0] - zoom_1 * self.plakativ.layout["overallsize"][0]
|
||||
) / 2
|
||||
|
@ -1358,6 +1353,8 @@ class Application(tkinter.Frame):
|
|||
)
|
||||
# remove alpha channel
|
||||
if remove_alpha:
|
||||
from PIL import Image
|
||||
|
||||
img = Image.open(self.filename).convert("RGBA")
|
||||
background = Image.new("RGBA", img.size, (255, 255, 255))
|
||||
img = Image.alpha_composite(background, img)
|
||||
|
@ -1714,7 +1711,6 @@ class BorderSizeWidget(tkinter.LabelFrame):
|
|||
]
|
||||
):
|
||||
self.variables[n] = tkinter.DoubleVar()
|
||||
|
||||
# need to pass k and v as function arguments so that their value
|
||||
# does not get overwritten each loop iteration
|
||||
def callback(varname, idx, op, k_copy=n, v_copy=self.variables[n]):
|
||||
|
|
2
setup.py
2
setup.py
|
@ -1,6 +1,6 @@
|
|||
from setuptools import setup
|
||||
|
||||
VERSION = "0.5.2"
|
||||
VERSION = "0.5.1"
|
||||
|
||||
setup(
|
||||
name="plakativ",
|
||||
|
|
Loading…
Reference in a new issue