-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images should not be indexed on alt, but rather unique id #42
Comments
Yeah, this should be fixed. In my testing it doesn't replace any images but just discards the new one and places the original in the tweet instead. I'll fix the issues you found in my PR as well, thank you. I'll contact ccrsxx about the username bug as well. |
@Ketchupchh thank you! |
Yup, but that's by design. I made it so that when we upload the same image with the same alt, it will return the old image instead of creating the new image. It won't replace the old image with the new image tho. This is the code: twitter-clone/src/lib/firebase/utils.ts Lines 141 to 146 in c6bf6fb
I did it to reduce the bandwidth usage on the storage. But yeah, that's bad if you upload a different picture with the same alt, it'll return the old one. I see that the bandwidth usage isn't that much, so I think replacing the alt to id is good idea now. |
@ccrsxx Well, if you want to do this kind of optimisation I think that the better option would be to calculate a hash (e.g. sha256) of a file's content, and use that instead of a filename. That way, the same images with different names, would be stored only once. |
Yup, that could be the solution. But for now, I''ll be using the randomly generated id. |
Fixed in #40 |
Hi,
I believe that storing images based on the
alt
is not an good idea and instead uniqueid
should be used. The reason is that, uploading two images with the same filename (thus the samealt
s), replaces the previous image.Instead of
twitter-clone/src/lib/firebase/utils.ts
Line 139 in c6bf6fb
I would rather use
The text was updated successfully, but these errors were encountered: