kenenet 1.1.6__py3-none-any.whl → 1.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kenenet/__init__.py CHANGED
@@ -193,16 +193,27 @@ def save_img(img, name=' ', reset=True, file='temp_screenshots', mute=False):
193
193
  ospid = True
194
194
  frame = inspect.currentframe().f_back
195
195
  lineno = frame.f_lineno
196
- if isinstance(img, np.ndarray):
197
- save_name = name + f'{time.time()}'
198
- img = Image.fromarray(img)
199
- img.save(fr'{file}\{save_name}.png')
200
- if not mute: quick_print(f'Saved image as {save_name}', lineno)
201
- else:
202
- quick_print(f"Your img is not a fucking numpy array you twat, couldn't save {name}", lineno)
203
196
 
197
+ if not isinstance(img, np.ndarray):
198
+ quick_print(f"Your img is not a fucking numpy array you twat, couldn't save {name}", lineno)
199
+ return
204
200
 
201
+ save_name = name + f'{time.time()}'
202
+ arr = img
203
+ if arr.ndim == 3 and arr.shape[2] == 3:
204
+ im = Image.fromarray(arr)
205
+ else:
206
+ g = arr.squeeze()
207
+ if np.issubdtype(g.dtype, np.floating):
208
+ g = (np.clip(g, 0, 1) * 255).astype(np.uint8)
209
+ else:
210
+ g = g.astype(np.uint8)
211
+ im = Image.fromarray(g, mode='L')
205
212
 
213
+ path = os.path.join(file, f'{save_name}.png')
214
+ im.save(path)
215
+ if not mute:
216
+ quick_print(f'Saved image as {save_name}', lineno)
206
217
 
207
218
  class _load_audio:
208
219
  def __init__(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kenenet
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary: dude what the fuck even is this package
5
5
  Home-page: https://www.youtube.com/@KiddyKene
6
6
  Author: kiddykene
@@ -0,0 +1,5 @@
1
+ kenenet/__init__.py,sha256=6fDdc-6WpO8jipy2CyfYUYc6E3Q-RlD7M4iVtRZ9-6Y,21482
2
+ kenenet-1.1.7.dist-info/METADATA,sha256=gT81Xu95QgcjcRP1jzRcKn1bMpu2NdQkYb3SF21wDX4,1693
3
+ kenenet-1.1.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
+ kenenet-1.1.7.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
+ kenenet-1.1.7.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- kenenet/__init__.py,sha256=ZKpvVSipCdEwYO2zzJCq--ZPkALvoD8niQkZbUE299Y,21149
2
- kenenet-1.1.6.dist-info/METADATA,sha256=U-QjxxpfYTKPuoJy9JeFGq8WAfpa2_W7iP49P1gu6UY,1693
3
- kenenet-1.1.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
- kenenet-1.1.6.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
5
- kenenet-1.1.6.dist-info/RECORD,,