Skip to content

Commit

Permalink
do not fcking resize
Browse files Browse the repository at this point in the history
  • Loading branch information
wolffparkinson authored Jul 27, 2021
1 parent 0724c22 commit 1dd9b63
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions collage_maker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,29 @@ def _make(
ratio_v = 1.0
# if sum_border > IMAGE_COLLAGE_MAKER_PIXEL_LIM:
# ratio_v = sum_border / IMAGE_COLLAGE_MAKER_PIXEL_LIM
ratio = ratio / _np.max(ratio)
resizes = [
image
if r == 1 and ratio_v == 1
else _cv2.resize(
image,
dsize=None,
fx=1 / r / ratio_v,
fy=1 / r / ratio_v,
interpolation=_cv2.INTER_NEAREST,
)
for (image, r) in zip(cats, ratio)
]

if border_px != 0:
borders = [
_add_color_border_ul(image, border_px / ratio_last, border_color)
for image in resizes
]
border_px = border_px if frist else 0
cats = _add_color_border_br(
_np.concatenate(borders, axis=next_direction), border_px, border_color
)
else:
cats = _np.concatenate(resizes, axis=next_direction)
# ratio = ratio / _np.max(ratio)
# resizes = [
# image
# if r == 1 and ratio_v == 1
# else _cv2.resize(
# image,
# dsize=None,
# fx=1 / r / ratio_v,
# fy=1 / r / ratio_v,
# interpolation=_cv2.INTER_NEAREST,
# )
# for (image, r) in zip(cats, ratio)
# ]

# if border_px != 0:
# borders = [
# _add_color_border_ul(image, border_px / ratio_last, border_color)
# for image in resizes
# ]
# border_px = border_px if frist else 0
# cats = _add_color_border_br(
# _np.concatenate(borders, axis=next_direction), border_px, border_color
# )
# else:
# cats = _np.concatenate(resizes, axis=next_direction)
return cats, ratio_v

0 comments on commit 1dd9b63

Please sign in to comment.