Sign in to follow this  
joaosilva099

Report system with screenshot support

Recommended Posts

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?

Share this post


Link to post

And why can't you store your image data as a BLOB on a Database?

Share this post


Link to post
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 :D

Share this post


Link to post
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')

Share this post


Link to post

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.

Share this post


Link to post
You're putting extra hits on your database transactions that you can completely avoid.

That just says everything.

Share this post


Link to post

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..

Share this post


Link to post

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

Share this post


Link to post

If you want an un-optimized server, then go ahead :D 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 :)

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.