Skip to content

Commit

Permalink
Merge pull request #1 from MattyBoy4444/MattyBoy4444-pngsupport-1
Browse files Browse the repository at this point in the history
Added support for PNG's.
  • Loading branch information
MattyBoy authored Jan 16, 2019
2 parents 2a4a23b + 9101a53 commit 73fe5cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions titanium_backup_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,12 @@ def create_output_file(self, conversations, self_gaia_id, output_file_name):
if attachment.original_content_url is not None:
data = self._convert_url_to_base64_data(attachment.original_content_url)
if data is not None:
message_string += MMS_PART.format("image/jpeg", order, "base64", data)
order += 1
if ".png" in attachment.download_url:
message_string += MMS_PART.format("image/png", order, "base64", data)
order += 1
else:
message_string += MMS_PART.format("image/jpeg", order, "base64", data)
order += 1
else:
print("Error: unable to download image data!")
elif attachment.media_type == "ANIMATED_PHOTO":
Expand Down

0 comments on commit 73fe5cd

Please sign in to comment.