joaosilva099 Posted December 19, 2014 Share Posted December 19, 2014 Hi all! This time I am trying to make a report system with screenshot support. First, I though using onPlayerScreenShot and save the imageData to a database, then I discovered that I can't convert image data to text. I don't want to spend too much disk space with images. How can I do that? Link to comment
MTA Team 0xCiBeR Posted December 19, 2014 MTA Team Share Posted December 19, 2014 You could store the data on a remote Web Server. Link to comment
joaosilva099 Posted December 19, 2014 Author Share Posted December 19, 2014 Hmm... it would spend BandWidth everytime a player takes a screenshot... and that noobs can spam F12 and lag everything Link to comment
MTA Team 0xCiBeR Posted December 19, 2014 MTA Team Share Posted December 19, 2014 And why can't you store your image data as a BLOB on a Database? Link to comment
joaosilva099 Posted December 19, 2014 Author Share Posted December 19, 2014 And why can't you store your image data as a BLOB on a Database? Because I didn't even know for what the BLOB data type was. (Google helped me AGAIN!) THANKSSSS Link to comment
MTA Team 0xCiBeR Posted December 19, 2014 MTA Team Share Posted December 19, 2014 No problem! Link to comment
Feche1320 Posted December 20, 2014 Share Posted December 20, 2014 Yes, you can store images in the database, but it's not advisable and bad practice.Do not store images in the database. Store images in directories and store references to the images in the database. Like store the path to the image in the database or the image name in the database. Images can get quite large 1MB >. Even if it's a small image, it's still bad practice. You're putting extra hits on your database transactions that you can completely avoid. No big websites stores images in their database. Craigslist doesn't do it. Facebook doesn't do it. It's not a good idea. Do as the guy said, store just the references.. what Ciber said is wrong.. you could do something like INSERT INTO yourtablename VALUES ('reportedaccount', 'reportreason', 'pathtoscreenshot') Link to comment
MTA Team 0xCiBeR Posted December 20, 2014 MTA Team Share Posted December 20, 2014 Actually it's not wrong. Depends on how much network you count on, besides there are many sites that do use this method, tho it's not quite practical, it's a good method and saves Web host space. You could link the file path asigning it to the report, there are more than one way of achieving the same thing. I think it's not safe to say that one way or another is right or wrong. Link to comment
Feche1320 Posted December 20, 2014 Share Posted December 20, 2014 You're putting extra hits on your database transactions that you can completely avoid. That just says everything. Link to comment
MTA Team 0xCiBeR Posted December 20, 2014 MTA Team Share Posted December 20, 2014 It's just a heavy query, you don't need more than 1 query to store an image. Besides, if you have a DB server, you might as well use it.. Link to comment
joaosilva099 Posted December 20, 2014 Author Share Posted December 20, 2014 My images will have no more than 30KB size. And CiBeR is right. The query just takes longer if i am using that table wich will only contain reports. Other tables may work fine Link to comment
Feche1320 Posted December 20, 2014 Share Posted December 20, 2014 If you want an un-optimized server, then go ahead I just tried to help you in another way, take it or leave it. Next week you will be asking why your server lags when loading reports, gl Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now