Skip to content

Commit

Permalink
Merge pull request #1 from Amirhan-Taipovjan-Greatest-I/pillow->=10-s…
Browse files Browse the repository at this point in the history
…upport

Pillow >=10 support, so this program will be working (tested by Me).
  • Loading branch information
Amirhan-Taipovjan-Greatest-I authored Dec 16, 2023
2 parents 7879374 + e92882e commit 0b1cc41
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
34 changes: 17 additions & 17 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<p align=center><a href=http://python.org/downloads/release/python-376><img src=https://img.shields.io/badge/Python-3.7.6-brightgreen?logo=python&logoColor=white&link=http://python.org/downloads/release/python-376&style=for-the-badge></a>

<p align=center><a href=http://github.com/UhhhAaron/iFunny-Captions/releases/><img src=https://img.shields.io/github/v/release/UhhhAaron/iFunny-Captions?style=for-the-badge></a> <a href=http://github.com/UhhhAaron/iFunny-Captions/blob/master/License.txt><img src=https://img.shields.io/github/license/UhhhAaron/iFunny-Captions?logo=readthedocs&color=red&logoColor=white&style=for-the-badge></a></p>
<p align=center><a href=http://github.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/releases/><img src=https://img.shields.io/github/v/release/Amirhan-Taipovjan-Greatest-I/iFunny-Captions?style=for-the-badge></a> <a href=http://github.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/blob/master/License.txt><img src=https://img.shields.io/github/license/Amirhan-Taipovjan-Greatest-I/iFunny-Captions?logo=readthedocs&color=red&logoColor=white&style=for-the-badge></a></p>


### GIF-Caption-Creator is a pack of scripts providing widely customizable [GIF caption](http://knowyourmeme.com/memes/gif-captions) generation.
### iFunny-Captions is a pack of scripts providing widely customizable [GIF caption](http://knowyourmeme.com/memes/gif-captions) generation.

## Capabilities
| | iFunny App | `GIF-Caption-Creator` |
| | iFunny App | `iFunny-Captions` |
|:-:|:-:|:-:|
| PNG Captions | ✔️ | ✔️ |
| GIF Captions | ✔️ | ✔️ |
Expand All @@ -17,7 +17,7 @@
| Custom Fonts || ✔️ |
| Emoji support | ✔️ | ✔️ |
| Crop support | ✔️ ||
| Graphical User Interface | ✔️ | ❌ <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Main/Google_Colab.svg width=25> |
| Graphical User Interface | ✔️ | ❌ <img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/Main/Google_Colab.svg width=25> |
| Batch Processing || ✔️ |
---
## Completed & Planned Features
Expand All @@ -32,7 +32,7 @@
- ✔️ Emoji support<sup>3</sup>
- ✔️ Automatic text wrap

<sup>1</sup> - Please look at [Custom Fonts](http://github.com/UhhhAaron/GIF-Caption-Creator/wiki/Custom-Fonts) section in wiki.<br>
<sup>1</sup> - Please look at [Custom Fonts](http://github.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/wiki/Custom-Fonts) section in wiki.<br>
<sup>2</sup> - Problems with wrap height might occur.

## Requirements
Expand Down Expand Up @@ -82,7 +82,7 @@ This project was tested on:
|:-:|:-:|
Windows 10 | 3.7.6

[**If there are problems, create an issue here.**](http://github.com/UhhhAaron/GIF-Caption-Creator/issues/new/choose)
[**If there are problems, create an issue here.**](http://github.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/issues/new/choose)

---
### Supported GIF services
Expand All @@ -104,15 +104,15 @@ Be sure to copy the **raw image URL**.
</thead>
<tbody>
<tr align=center>
<td><a href=http://tenor.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/Tenor.svg alt=Tenor width=65></a></td>
<td><a href=http://giphy.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/Giphy.svg alt=Giphy width=65></a></td>
<td><a href=http://gfycat.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/Gfycat.svg alt=Gfycat width=65></a></td>
<td><a href=http://tumblr.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/Tumblr.svg alt=Tumblr width=65></a></td>
<td><a href=http://imgflip.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/ImgFlip.svg alt=ImgFlip width=65></a></td>
<td><a href=http://gifimage.net target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/GifImage.png alt=GifImage width=65></a></td>
<td><a href=http://bestanimations.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/BestAnimations.png alt=BestAnimations width=65></a></td>
<td><a href=http://gif-finder.com target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/GifFinder.png alt=GifFinder width=65></a></td>
<td><a href=http://reactiongifs.us target="_blank"><img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/GIF_Image_Services_Logos/ReactionGIFs.svg alt=ReactionGIFs width=65></a></td>
<td><a href=http://tenor.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/Tenor.svg alt=Tenor width=65></a></td>
<td><a href=http://giphy.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/Giphy.svg alt=Giphy width=65></a></td>
<td><a href=http://gfycat.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/Gfycat.svg alt=Gfycat width=65></a></td>
<td><a href=http://tumblr.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/Tumblr.svg alt=Tumblr width=65></a></td>
<td><a href=http://imgflip.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/ImgFlip.svg alt=ImgFlip width=65></a></td>
<td><a href=http://gifimage.net target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/GifImage.png alt=GifImage width=65></a></td>
<td><a href=http://bestanimations.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/BestAnimations.png alt=BestAnimations width=65></a></td>
<td><a href=http://gif-finder.com target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/GifFinder.png alt=GifFinder width=65></a></td>
<td><a href=http://reactiongifs.us target="_blank"><img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/GIF_Image_Services_Logos/ReactionGIFs.svg alt=ReactionGIFs width=65></a></td>
</tr>
</tbody>
</table>
Expand All @@ -122,5 +122,5 @@ Be sure to copy the **raw image URL**.

- | iFunny Android App | `GIF-Caption-Creator` |
|:-:|:-:|
| <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/1/iFunny.gif width=150> | <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/1/iFunny-Captions.gif width=150>
| <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/2/iFunny.gif width=150> | <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/2/iFunny-Captions.gif width=150> |
| <img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/Comparison_Graphics/1/iFunny.gif width=150> | <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/1/iFunny-Captions.gif width=150>
| <img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/Comparison_Graphics/2/iFunny.gif width=150> | <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Comparison_Graphics/2/iFunny-Captions.gif width=150> |
28 changes: 14 additions & 14 deletions Scripts/Caption.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Text = wrap(

#Text = wrap(
# "{0}".format(Config["Text"]["Content"]),
# width = Font.getsize(
# sorted(Text, key = len)[-1])[0] - int(Config["Text"]["Additional_Wrap"] * 2
# width = Font.getlength(
# int(sorted(Text, key = len)[-1])) - int(Config["Text"]["Additional_Wrap"] * 2
# )
#)

Expand All @@ -123,8 +123,8 @@ for Line in Text:
Line_Image = Image.new(
"RGBA",
(
Font.getsize("x")[0] * len(Line) * 2,
Font.getsize("pÓ")[1] * 2
int(Font.getlength("x")) * len(Line) * 2,
int(Font.getlength("pÓ")) * 2
)
)
Line_ImageDraw = ImageDraw.Draw(Line_Image)
Expand All @@ -147,7 +147,7 @@ for Line in Text:
Emoji = Emoji.resize(
(
Percentage(
Font.getsize("pÓ")[1], 75
int(Font.getlength("pÓ")), 75
),
) * 2, 1
)
Expand All @@ -156,7 +156,7 @@ for Line in Text:
Emoji,
(
__X,
Font.getsize("p")[1] - Font.getsize("o")[1],
int(Font.getlength("p")) - int(Font.getlength("o")),
),
Emoji
)
Expand All @@ -170,15 +170,15 @@ for Line in Text:
fill = __Fill
)
#-=-=-=-#
__X += Font.getsize(Character)[0] + Config["Text"]["Kerning"]
__X += int(Font.getlength(Character)) + Config["Text"]["Kerning"]
#-=-=-=-#
Line_Image = Line_Image.crop(Line_Image.getbbox())

Line_Image_2 = Image.new(
Line_Image.mode,
(
Line_Image.size[0],
Font.getsize("yÓ")[1] + 5
int(Font.getlength("yÓ")) + 5
)
)
Line_Image_2.paste(Line_Image, (0, 0), Line_Image)
Expand All @@ -192,15 +192,15 @@ for IMG in enumerate(Images):
"RGBA",
(
Images[IMG].size[0],
Images[IMG].size[1] + Font.getsize("yÓ")[1] + len(Images) * 10
Images[IMG].size[1] + int(Font.getlength("yÓ")) + len(Images) * 10
),
(0,) * 4
) # Bug
Text_Image.paste(
Images[IMG],
(
0,
Font.getsize("yÓ")[1]
int(Font.getlength("yÓ"))
),
Images[IMG]
)
Expand All @@ -213,7 +213,7 @@ for IMG in enumerate(Expanded_Images):
__Y += Expanded_Images[0].size[1] // len(Expanded_Images)
else:
__Y += Percentage(
Font.getsize("yÓ")[1], 112
int(Font.getlength("yÓ")), 112
) + 5
Image_Base.paste(
Expanded_Images[IMG],
Expand All @@ -233,7 +233,7 @@ Pasted = Image.new(
(
int(Config["Media"]["Image"]["Max_Width"]),
Image_Base.size[1] + Percentage(
Font.getsize("yÓ")[1], 150
int(Font.getlength("yÓ")), 150
)
),
__Pasted_Color
Expand All @@ -242,7 +242,7 @@ Pasted.paste(
Image_Base,
(
(Pasted.size[0] - Image_Base.size[0]) // 2,
(Pasted.size[1] - Image_Base.size[1]) // 2 + ((Font.getsize("yÓ")[1] - Font.getsize("Ó")[1]) if list("qypgj") in Text[:-1] else 0)
(Pasted.size[1] - Image_Base.size[1]) // 2 + (int(Font.getlength("yÓ")) - int(Font.getlength("Ó")) if list("qypgj") in Text[:-1] else 0)
),
Image_Base
)
Expand All @@ -263,4 +263,4 @@ if Config["Media"]["Image"]["Watermark"]:
Pasted.size[1] - Watermark.size[1] - WM_Offset
),
Watermark
)
)

0 comments on commit 0b1cc41

Please sign in to comment.