webdevhub
webdevhub copied to clipboard
Create an image conversion system
Allow a user to be able to convert image types such as png to jpg
, jpeg to png
etc.
Hi, I'd like to try this
@foobar41 Hey! You're welcome to try it. If you create your own fork for the repository, you can start making changes. If you look at the How to Contribute
section of the README, it will explain the steps for how to add a new feature to the site by cloning the repo, making a new folder, adding the link to home etc. If you have any problems or questions let me know, I'm happy to help!
What framework are you using for the server-side? Converting format in client-side using javascript seems to give very few options
Hey! Currently no server-side code is being used, as the site is being hosted with GitHub pages which does not support server-based applications.
From: Akhil Galla @.> Sent: Monday, June 27, 2022 3:17:08 AM To: THHamiltonSmith/webdevhub @.> Cc: Thomas Hamilton-Smith @.>; Author @.> Subject: Re: [THHamiltonSmith/webdevhub] Create an image conversion system (Issue #1)
What framework are you using for the server-side? Converting format in client-side using javascript seems to give very few options
— Reply to this email directly, view it on GitHubhttps://github.com/THHamiltonSmith/webdevhub/issues/1#issuecomment-1166599333, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEYBD645HR3YOMV5SOPYMGDVRCJRZANCNFSM5Z2I6OFA. You are receiving this because you authored the thread.Message ID: @.***>
Thanks for letting me know, I will try a different method then
If you can’t figure out a way without using server side such as node, maybe try something else or put it off.
If the project gets enough traction, I will consider paying for a VPS to host the site on so more content can be added to the site. If this happens, we can use node to make adding stuff like this easier.
From: Akhil Galla @.> Sent: Monday, June 27, 2022 3:30:02 AM To: THHamiltonSmith/webdevhub @.> Cc: Thomas Hamilton-Smith @.>; Author @.> Subject: Re: [THHamiltonSmith/webdevhub] Create an image conversion system (Issue #1)
Thanks for letting me know, I will try a different method then
— Reply to this email directly, view it on GitHubhttps://github.com/THHamiltonSmith/webdevhub/issues/1#issuecomment-1166602254, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEYBD6YENT3MUI3Q6WSXQNLVRCLCFANCNFSM5Z2I6OFA. You are receiving this because you authored the thread.Message ID: @.***>
All right, I will let you know soon.
Closing this for now until the time comes for the image conversion system to be revisited.
@foobar41, the site is now hosted on Heroku and uses Node.js, so if you would like to take another crack at the image conversion system, I have re-opened this issue.
Sure, I'll give it a try
Hey @THHamiltonSmith, I've implemented it to convert to different formats but finding it difficult to download the processed image unless it is saved somewhere. Is it okay if I keep the image somewhere in the file directory? I am using Sharp and Multer packages in node, please share any ideas if you have
@foobar41 yep that sounds fine. Maybe add a directory in the /public
folder called /uploads
or something like that where the images can be stored. If possible, try adding a timer that will run and delete the image after 15 minutes so it doesn't clog up storage and for user security.
Great work! Let me know if you need any more help.
@THHamiltonSmith shouldn't the converted file be stored in something like a DynamoDB storage, where it will be purged after a given timeout?
We can use node to delete files with a timer, btw I don't know how to use DynamoDB storage 😅. What I am thinking is deleting current files in /uploads
and then storing the converted file in the directory, that way there will always be a single file in that directory without taking up much space and this file will be deleted in the next operation. What do you think of this? Should I use a timer to delete files? Is there a better way to do this?
That will be good for now. If we encounter problems once the site gets more traffic we can switch up how we do it to be more efficient. You could also add a timer to delete the file automatically after for example an hour if you like.