Skip to content

Commit 0b1cc41

Browse files
Merge pull request #1 from Amirhan-Taipovjan-Greatest-I/pillow->=10-support
Pillow >=10 support, so this program will be working (tested by Me).
2 parents 7879374 + e92882e commit 0b1cc41

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

ReadMe.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<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>
44

5-
<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>
5+
<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>
66

77

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

1010
## Capabilities
11-
| | iFunny App | `GIF-Caption-Creator` |
11+
| | iFunny App | `iFunny-Captions` |
1212
|:-:|:-:|:-:|
1313
| PNG Captions | ✔️ | ✔️ |
1414
| GIF Captions | ✔️ | ✔️ |
@@ -17,7 +17,7 @@
1717
| Custom Fonts || ✔️ |
1818
| Emoji support | ✔️ | ✔️ |
1919
| Crop support | ✔️ ||
20-
| Graphical User Interface | ✔️ | ❌ <img src=https://raw.githubusercontent.com/UhhhAaron/GIF-Caption-Creator/master/Documents/Pictures/Main/Google_Colab.svg width=25> |
20+
| Graphical User Interface | ✔️ | ❌ <img src=https://raw.githubusercontent.com/Amirhan-Taipovjan-Greatest-I/iFunny-Captions/master/Documents/Pictures/Main/Google_Colab.svg width=25> |
2121
| Batch Processing || ✔️ |
2222
---
2323
## Completed & Planned Features
@@ -32,7 +32,7 @@
3232
- ✔️ Emoji support<sup>3</sup>
3333
- ✔️ Automatic text wrap
3434

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

3838
## Requirements
@@ -82,7 +82,7 @@ This project was tested on:
8282
|:-:|:-:|
8383
Windows 10 | 3.7.6
8484

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

8787
---
8888
### Supported GIF services
@@ -104,15 +104,15 @@ Be sure to copy the **raw image URL**.
104104
</thead>
105105
<tbody>
106106
<tr align=center>
107-
<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>
108-
<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>
109-
<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>
110-
<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>
111-
<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>
112-
<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>
113-
<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>
114-
<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>
115-
<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>
107+
<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>
108+
<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>
109+
<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>
110+
<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>
111+
<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>
112+
<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>
113+
<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>
114+
<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>
115+
<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>
116116
</tr>
117117
</tbody>
118118
</table>
@@ -122,5 +122,5 @@ Be sure to copy the **raw image URL**.
122122

123123
- | iFunny Android App | `GIF-Caption-Creator` |
124124
|:-:|:-:|
125-
| <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>
126-
| <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> |
125+
| <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>
126+
| <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> |

Scripts/Caption.pyw

+14-14
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ Text = wrap(
107107

108108
#Text = wrap(
109109
# "{0}".format(Config["Text"]["Content"]),
110-
# width = Font.getsize(
111-
# sorted(Text, key = len)[-1])[0] - int(Config["Text"]["Additional_Wrap"] * 2
110+
# width = Font.getlength(
111+
# int(sorted(Text, key = len)[-1])) - int(Config["Text"]["Additional_Wrap"] * 2
112112
# )
113113
#)
114114

@@ -123,8 +123,8 @@ for Line in Text:
123123
Line_Image = Image.new(
124124
"RGBA",
125125
(
126-
Font.getsize("x")[0] * len(Line) * 2,
127-
Font.getsize("pÓ")[1] * 2
126+
int(Font.getlength("x")) * len(Line) * 2,
127+
int(Font.getlength("pÓ")) * 2
128128
)
129129
)
130130
Line_ImageDraw = ImageDraw.Draw(Line_Image)
@@ -147,7 +147,7 @@ for Line in Text:
147147
Emoji = Emoji.resize(
148148
(
149149
Percentage(
150-
Font.getsize("pÓ")[1], 75
150+
int(Font.getlength("pÓ")), 75
151151
),
152152
) * 2, 1
153153
)
@@ -156,7 +156,7 @@ for Line in Text:
156156
Emoji,
157157
(
158158
__X,
159-
Font.getsize("p")[1] - Font.getsize("o")[1],
159+
int(Font.getlength("p")) - int(Font.getlength("o")),
160160
),
161161
Emoji
162162
)
@@ -170,15 +170,15 @@ for Line in Text:
170170
fill = __Fill
171171
)
172172
#-=-=-=-#
173-
__X += Font.getsize(Character)[0] + Config["Text"]["Kerning"]
173+
__X += int(Font.getlength(Character)) + Config["Text"]["Kerning"]
174174
#-=-=-=-#
175175
Line_Image = Line_Image.crop(Line_Image.getbbox())
176176

177177
Line_Image_2 = Image.new(
178178
Line_Image.mode,
179179
(
180180
Line_Image.size[0],
181-
Font.getsize("yÓ")[1] + 5
181+
int(Font.getlength("yÓ")) + 5
182182
)
183183
)
184184
Line_Image_2.paste(Line_Image, (0, 0), Line_Image)
@@ -192,15 +192,15 @@ for IMG in enumerate(Images):
192192
"RGBA",
193193
(
194194
Images[IMG].size[0],
195-
Images[IMG].size[1] + Font.getsize("yÓ")[1] + len(Images) * 10
195+
Images[IMG].size[1] + int(Font.getlength("yÓ")) + len(Images) * 10
196196
),
197197
(0,) * 4
198198
) # Bug
199199
Text_Image.paste(
200200
Images[IMG],
201201
(
202202
0,
203-
Font.getsize("yÓ")[1]
203+
int(Font.getlength("yÓ"))
204204
),
205205
Images[IMG]
206206
)
@@ -213,7 +213,7 @@ for IMG in enumerate(Expanded_Images):
213213
__Y += Expanded_Images[0].size[1] // len(Expanded_Images)
214214
else:
215215
__Y += Percentage(
216-
Font.getsize("yÓ")[1], 112
216+
int(Font.getlength("yÓ")), 112
217217
) + 5
218218
Image_Base.paste(
219219
Expanded_Images[IMG],
@@ -233,7 +233,7 @@ Pasted = Image.new(
233233
(
234234
int(Config["Media"]["Image"]["Max_Width"]),
235235
Image_Base.size[1] + Percentage(
236-
Font.getsize("yÓ")[1], 150
236+
int(Font.getlength("yÓ")), 150
237237
)
238238
),
239239
__Pasted_Color
@@ -242,7 +242,7 @@ Pasted.paste(
242242
Image_Base,
243243
(
244244
(Pasted.size[0] - Image_Base.size[0]) // 2,
245-
(Pasted.size[1] - Image_Base.size[1]) // 2 + ((Font.getsize("yÓ")[1] - Font.getsize("Ó")[1]) if list("qypgj") in Text[:-1] else 0)
245+
(Pasted.size[1] - Image_Base.size[1]) // 2 + (int(Font.getlength("yÓ")) - int(Font.getlength("Ó")) if list("qypgj") in Text[:-1] else 0)
246246
),
247247
Image_Base
248248
)
@@ -263,4 +263,4 @@ if Config["Media"]["Image"]["Watermark"]:
263263
Pasted.size[1] - Watermark.size[1] - WM_Offset
264264
),
265265
Watermark
266-
)
266+
)

0 commit comments

Comments
 (0)