fix: cleanup all external CC-BY-SA works for license compliance
This commit is contained in:
1 parent
2198eeee59
commit
3e472acfb8
3 files changed
+37
-33
No files matched your search
@@ -50,7 +50,7 @@ def register(ctx: AuroraContext) -> None:
|
||||
"std/mimetype/image-jpeg",
|
||||
(
|
||||
TempArtSource("component", "image-base.png"),
|
||||
BitmapSource("bitmap", "Niinsaare_järv.jpg"),
|
||||
BitmapSource("bitmap", "Herbert_Lake_beim_Icefields_Parkway.jpg"),
|
||||
TempArtSink("image-jpeg.png"),
|
||||
FdArtSink(FdContext.MimeTypes, "image-jpeg"),
|
||||
IcoArtSink(IcoCategory.Extension, "jpg"),
|
||||
@@ -63,8 +63,8 @@ def register(ctx: AuroraContext) -> None:
|
||||
"std/mimetype/image-png",
|
||||
(
|
||||
TempArtSource("component", "image-base.png"),
|
||||
BitmapSource("bitmap", "Tulipa_suaveolens_floriade_to_Canberra.jpg"),
|
||||
BitmapSource("bitmap", "Tulipa_suaveolens_floriade_to_Canberra-mask.png"),
|
||||
BitmapSource("bitmap", "Narzisse.jpg"),
|
||||
BitmapSource("bitmap", "Narzisse-mask.png"),
|
||||
SvgSource("image-png-checkerboard.svg"),
|
||||
FdArtSink(FdContext.MimeTypes, "image-png"),
|
||||
IcoArtSink(IcoCategory.Extension, "png"),
|
||||
@@ -89,7 +89,7 @@ def register(ctx: AuroraContext) -> None:
|
||||
"std/mimetype/image-gif",
|
||||
(
|
||||
TempArtSource("component", "image-base.png"),
|
||||
BitmapSource("bitmap", "Hot-air_balloon_in_Tambov_-_02.jpg"),
|
||||
BitmapSource("bitmap", "Kite_(23729899095).jpg"),
|
||||
FdArtSink(FdContext.MimeTypes, "image-gif"),
|
||||
IcoArtSink(IcoCategory.Extension, "gif"),
|
||||
MsixArtSink(MsixCategory.Extension, "gif"),
|
||||
@@ -130,15 +130,8 @@ def build_image_jpeg_icon(
|
||||
|
||||
jpg_image_inner = bitmap_src.pull(env)
|
||||
with jpg_image_inner:
|
||||
# crop the area which is interested by ourselves
|
||||
interest_area = Rectangle.from_pos_size_rect(Point(2700, 0), 5016, 3888)
|
||||
crop_jpg_image_inner = jpg_image_inner.crop(interest_area.to_tuple())
|
||||
# do a flip
|
||||
flip_jpg_image_inner = crop_jpg_image_inner.transpose(
|
||||
PIL.Image.Transpose.FLIP_LEFT_RIGHT
|
||||
)
|
||||
# enhance its saturation
|
||||
enhancer = PIL.ImageEnhance.Color(flip_jpg_image_inner)
|
||||
enhancer = PIL.ImageEnhance.Color(jpg_image_inner)
|
||||
saturated_jpg_image_inner = enhancer.enhance(1.4)
|
||||
|
||||
# fit to inner rect
|
||||
@@ -147,8 +140,9 @@ def build_image_jpeg_icon(
|
||||
IMAGE_INNER_RECT.width,
|
||||
IMAGE_INNER_RECT.height,
|
||||
PIL.Image.Resampling.NEAREST,
|
||||
HorizontalAnchor.Center,
|
||||
VerticalAnchor.Center,
|
||||
# Left-top to keep more sky and more our interested area.
|
||||
HorizontalAnchor.Left,
|
||||
VerticalAnchor.Top,
|
||||
)
|
||||
# paste into inner rect
|
||||
jpg_image.paste(bestfit_jpg_image_inner, IMAGE_INNER_RECT.to_tuple())
|
||||
@@ -194,8 +188,8 @@ def build_image_png_icon(
|
||||
IMAGE_INNER_RECT.width,
|
||||
IMAGE_INNER_RECT.height,
|
||||
PIL.Image.Resampling.NEAREST,
|
||||
HorizontalAnchor.Center,
|
||||
VerticalAnchor.Top,
|
||||
HorizontalAnchor.Left,
|
||||
VerticalAnchor.Center,
|
||||
)
|
||||
# TODO: When bestfit this checkerboard, the border of this checkerboard aer lost.
|
||||
# We may need resolve this in future but currently it is so subtle to notice.
|
||||
@@ -271,10 +265,14 @@ def build_image_gif_icon(
|
||||
|
||||
gif_image_inner = bitmap_src.pull(env)
|
||||
with gif_image_inner:
|
||||
# crop the area which is interested by ourselves
|
||||
interest_area = Rectangle.from_pos_size_rect(Point(1600, 520), 2752, 1992)
|
||||
crop_gif_image_inner = gif_image_inner.crop(interest_area.to_tuple())
|
||||
|
||||
# we use the whole image as the inner,
|
||||
# so we directly fit it to inner.
|
||||
bestfit_inner = aspect_ratio_scale_and_crop(
|
||||
gif_image_inner,
|
||||
crop_gif_image_inner,
|
||||
IMAGE_INNER_RECT.width,
|
||||
IMAGE_INNER_RECT.height,
|
||||
PIL.Image.Resampling.NEAREST,
|
||||
|
||||
Reference in new issue
Block a user