diff options
Diffstat (limited to 'python-polaroid.spec')
-rw-r--r-- | python-polaroid.spec | 341 |
1 files changed, 341 insertions, 0 deletions
diff --git a/python-polaroid.spec b/python-polaroid.spec new file mode 100644 index 0000000..be74aff --- /dev/null +++ b/python-polaroid.spec @@ -0,0 +1,341 @@ +%global _empty_manifest_terminate_build 0 +Name: python-polaroid +Version: 0.3.2 +Release: 1 +Summary: Hyper Fast and safe image manipulation library for python. Powered by rust. +License: MIT +URL: https://github.com/Daggy1234/polaroid +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e7/be/0219c1573f3a2306c4f4895d92cfd2029af239a12475288e1855045bbd65/polaroid-0.3.2.tar.gz + + +%description +# Polaroid + +[](https://github.com/Daggy1234/polaroid/actions/workflows/publish.yml)        [](https://www.codacy.com/gh/Daggy1234/polaroid/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Daggy1234/polaroid&utm_campaign=Badge_Grade) + +## Hyper fast image processing + +This is a Work in Progress. DO NOT USE in production. + +For all the examples, meme.png is used. Please replace that with whatever Image you use + +### Via File System + +```python +from polaroid import Image +im = Image("meme.png") +im.solarize() +im.save("solar.png") +``` + +### Using Bytes + +```python +# Just an example use any library to supply bytes +from polaroid import Image +import requests +byt = requests.get("https://dagpi.xyz/dagpi.png").content +im = Image(byt) +im.filter("dramatic") +ret_byt = im.save_bytes() +``` + +### Properties + +```python +from polaroid import Image +im = Image("meme.png") +h = im.height +w = im.weight +wi,hei = im.size +image_format = im.format +mode = im.mode +``` + +### Using the RGB class for coloring + +```py +from polaroid import Image, Rgb +im = Image("meme.png") +# Color Rgb +color = Rgb(78, 93, 148) +im.color(color) + +# Now Save + +``` + +### Methods + +#### Image Methods + +```python +['add_noise_rand', 'adjust_contrast', 'alter_blue_channel', 'alter_channel', 'alter_channels', 'alter_green_channel', 'alter_red_channel', 'apply_gradient', 'b_grayscale', 'blend', 'box_blur', 'brighten', 'color', 'color_no_grayscale', 'colorize', 'crop', 'decompose_max', 'decompose_min', 'desaturate', 'detect_horizontal_lines', 'detect_vertical_lines', 'edge_detection', 'edge_one', 'emboss', 'filter', 'fliph', 'flipv', 'g_grayscale', 'gaussian_blur', 'gradient', 'grayscale', 'grayscale_human_corrected', 'grayscale_shades', 'hog', 'horizontal_strips', 'identity', 'inc_brightness', 'invert', 'laplace', 'liquid_rescale', 'monochrome', 'noise_reduction', 'offset', 'offset_blue', 'offset_green', 'offset_red', 'oil', 'pink_noise', 'prewitt_horizontal', 'primary', 'r_grayscale', 'remove_blue_channel', 'remove_green_channel', 'remove_red_channel', 'replace_backround', 'resize', 'rotate180', 'rotate270', 'rotate90', 'save', 'save_base_64', 'save_bytes', 'save_jpeg_bytes', 'selective_desaturate', 'selective_hue_rotate', 'selective_lighten', 'selective_saturate', 'sepia', 'sharpen', 'single_channel_grayscale', 'sobel_horizontal', 'sobel_vertical', 'solarize', 'swap_channels', 'threshold', 'thumbnail', 'tint', 'unsharpen', 'vertical_strips', 'watermark'] +#All available for Image +``` + +#### Rgb Methods + +```py + +``` + +### Special Methods for `Image` + +```python +from polaroid import Image +im = Image("meme.png") +print(repr(im)) + +#The `bytes` method is not implemented use +byt = im.save_bytes() + +# Save a jpeg + +im.save_jpeg(quaility: int) + +byt = im.save_jpeg_bytes(quality: int) +``` + + + + +%package -n python3-polaroid +Summary: Hyper Fast and safe image manipulation library for python. Powered by rust. +Provides: python-polaroid +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-polaroid +# Polaroid + +[](https://github.com/Daggy1234/polaroid/actions/workflows/publish.yml)        [](https://www.codacy.com/gh/Daggy1234/polaroid/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Daggy1234/polaroid&utm_campaign=Badge_Grade) + +## Hyper fast image processing + +This is a Work in Progress. DO NOT USE in production. + +For all the examples, meme.png is used. Please replace that with whatever Image you use + +### Via File System + +```python +from polaroid import Image +im = Image("meme.png") +im.solarize() +im.save("solar.png") +``` + +### Using Bytes + +```python +# Just an example use any library to supply bytes +from polaroid import Image +import requests +byt = requests.get("https://dagpi.xyz/dagpi.png").content +im = Image(byt) +im.filter("dramatic") +ret_byt = im.save_bytes() +``` + +### Properties + +```python +from polaroid import Image +im = Image("meme.png") +h = im.height +w = im.weight +wi,hei = im.size +image_format = im.format +mode = im.mode +``` + +### Using the RGB class for coloring + +```py +from polaroid import Image, Rgb +im = Image("meme.png") +# Color Rgb +color = Rgb(78, 93, 148) +im.color(color) + +# Now Save + +``` + +### Methods + +#### Image Methods + +```python +['add_noise_rand', 'adjust_contrast', 'alter_blue_channel', 'alter_channel', 'alter_channels', 'alter_green_channel', 'alter_red_channel', 'apply_gradient', 'b_grayscale', 'blend', 'box_blur', 'brighten', 'color', 'color_no_grayscale', 'colorize', 'crop', 'decompose_max', 'decompose_min', 'desaturate', 'detect_horizontal_lines', 'detect_vertical_lines', 'edge_detection', 'edge_one', 'emboss', 'filter', 'fliph', 'flipv', 'g_grayscale', 'gaussian_blur', 'gradient', 'grayscale', 'grayscale_human_corrected', 'grayscale_shades', 'hog', 'horizontal_strips', 'identity', 'inc_brightness', 'invert', 'laplace', 'liquid_rescale', 'monochrome', 'noise_reduction', 'offset', 'offset_blue', 'offset_green', 'offset_red', 'oil', 'pink_noise', 'prewitt_horizontal', 'primary', 'r_grayscale', 'remove_blue_channel', 'remove_green_channel', 'remove_red_channel', 'replace_backround', 'resize', 'rotate180', 'rotate270', 'rotate90', 'save', 'save_base_64', 'save_bytes', 'save_jpeg_bytes', 'selective_desaturate', 'selective_hue_rotate', 'selective_lighten', 'selective_saturate', 'sepia', 'sharpen', 'single_channel_grayscale', 'sobel_horizontal', 'sobel_vertical', 'solarize', 'swap_channels', 'threshold', 'thumbnail', 'tint', 'unsharpen', 'vertical_strips', 'watermark'] +#All available for Image +``` + +#### Rgb Methods + +```py + +``` + +### Special Methods for `Image` + +```python +from polaroid import Image +im = Image("meme.png") +print(repr(im)) + +#The `bytes` method is not implemented use +byt = im.save_bytes() + +# Save a jpeg + +im.save_jpeg(quaility: int) + +byt = im.save_jpeg_bytes(quality: int) +``` + + + + +%package help +Summary: Development documents and examples for polaroid +Provides: python3-polaroid-doc +%description help +# Polaroid + +[](https://github.com/Daggy1234/polaroid/actions/workflows/publish.yml)        [](https://www.codacy.com/gh/Daggy1234/polaroid/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Daggy1234/polaroid&utm_campaign=Badge_Grade) + +## Hyper fast image processing + +This is a Work in Progress. DO NOT USE in production. + +For all the examples, meme.png is used. Please replace that with whatever Image you use + +### Via File System + +```python +from polaroid import Image +im = Image("meme.png") +im.solarize() +im.save("solar.png") +``` + +### Using Bytes + +```python +# Just an example use any library to supply bytes +from polaroid import Image +import requests +byt = requests.get("https://dagpi.xyz/dagpi.png").content +im = Image(byt) +im.filter("dramatic") +ret_byt = im.save_bytes() +``` + +### Properties + +```python +from polaroid import Image +im = Image("meme.png") +h = im.height +w = im.weight +wi,hei = im.size +image_format = im.format +mode = im.mode +``` + +### Using the RGB class for coloring + +```py +from polaroid import Image, Rgb +im = Image("meme.png") +# Color Rgb +color = Rgb(78, 93, 148) +im.color(color) + +# Now Save + +``` + +### Methods + +#### Image Methods + +```python +['add_noise_rand', 'adjust_contrast', 'alter_blue_channel', 'alter_channel', 'alter_channels', 'alter_green_channel', 'alter_red_channel', 'apply_gradient', 'b_grayscale', 'blend', 'box_blur', 'brighten', 'color', 'color_no_grayscale', 'colorize', 'crop', 'decompose_max', 'decompose_min', 'desaturate', 'detect_horizontal_lines', 'detect_vertical_lines', 'edge_detection', 'edge_one', 'emboss', 'filter', 'fliph', 'flipv', 'g_grayscale', 'gaussian_blur', 'gradient', 'grayscale', 'grayscale_human_corrected', 'grayscale_shades', 'hog', 'horizontal_strips', 'identity', 'inc_brightness', 'invert', 'laplace', 'liquid_rescale', 'monochrome', 'noise_reduction', 'offset', 'offset_blue', 'offset_green', 'offset_red', 'oil', 'pink_noise', 'prewitt_horizontal', 'primary', 'r_grayscale', 'remove_blue_channel', 'remove_green_channel', 'remove_red_channel', 'replace_backround', 'resize', 'rotate180', 'rotate270', 'rotate90', 'save', 'save_base_64', 'save_bytes', 'save_jpeg_bytes', 'selective_desaturate', 'selective_hue_rotate', 'selective_lighten', 'selective_saturate', 'sepia', 'sharpen', 'single_channel_grayscale', 'sobel_horizontal', 'sobel_vertical', 'solarize', 'swap_channels', 'threshold', 'thumbnail', 'tint', 'unsharpen', 'vertical_strips', 'watermark'] +#All available for Image +``` + +#### Rgb Methods + +```py + +``` + +### Special Methods for `Image` + +```python +from polaroid import Image +im = Image("meme.png") +print(repr(im)) + +#The `bytes` method is not implemented use +byt = im.save_bytes() + +# Save a jpeg + +im.save_jpeg(quaility: int) + +byt = im.save_jpeg_bytes(quality: int) +``` + + + + +%prep +%autosetup -n polaroid-0.3.2 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-polaroid -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 0.3.2-1 +- Package Spec generated |