Skip to content

Commit

Permalink
Update pixelateTG.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arbadacarbaYK authored May 29, 2024
1 parent d522697 commit ff2f728
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pixelateTG.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ def overlay(photo_path, user_id, overlay_type, resize_factor, bot):
# Adjust the overlay region to fit within the image
overlay_image_resized = overlay_image_resized[:roi_end_y - roi_start_y, :roi_end_x - roi_start_x]

# Ensure the overlay image and the ROI have the same dimensions
if overlay_image_resized.shape[0] != (roi_end_y - roi_start_y) or overlay_image_resized.shape[1] != (roi_end_x - roi_start_x):
continue

# Handle the alpha channel for transparency
alpha_mask = overlay_image_resized[:, :, 3] / 255.0
for c in range(0, 3):
Expand Down Expand Up @@ -256,6 +252,7 @@ def button_callback(update: Update, context: CallbackContext) -> None:
if processed_path:
context.bot.send_photo(chat_id=query.message.chat_id, photo=open(processed_path, 'rb'))


def main() -> None:
updater = Updater(TOKEN)

Expand Down

0 comments on commit ff2f728

Please sign in to comment.