Cocoa - Save profile / avatar image (png) in mysql database?

Key points:

  • This is my first game, which means that I am new to developing games for iOS.

  • My game uses a game center.

  • From what I know, you can log in to the game center on different devices, for example, log in using: UserA iPad or log in with the user's iPad or, possibly, log in with the user's iPhone, so I think that I have to save the profile picture (avatar) to a web database (online) (currently I am using mysql database)

  • The profile image size is not so huge (150x200 pixels, png format), so I think, save it as a BLOB type.

Questions:

  • Is it good to save the image as a BLOB type in my case ? (I know most of you will probably say that the path to the store image will be better, so I emphasize "in my case", I mean that I have to assume that the player can / can log in from different devices)

  • How to save a PNG image in a MySQL database? (FYI: I am currently using json (specifically: json-framework) to send and receive data such as username, ability, level, job from the database to the device).

If you have any ideas for saving the image or profile data, please share with me.

+3
source share

Source: https://habr.com/ru/post/1785151/


All Articles