THHamiltonSmith / webdevhub

A hub for web developers that offers a variety of tools to help with any developing needs.
https://webdevhub.herokuapp.com/
MIT License
87 stars 4 forks source link

Create an image conversion system #1

Open THHamiltonSmith opened 2 years ago

THHamiltonSmith commented 2 years ago

Allow a user to be able to convert image types such as png to jpg, jpeg to png etc.

foobar41 commented 2 years ago

Hi, I'd like to try this

THHamiltonSmith commented 2 years ago

@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!

foobar41 commented 2 years ago

What framework are you using for the server-side? Converting format in client-side using javascript seems to give very few options

THHamiltonSmith commented 2 years ago

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: @.***>

foobar41 commented 2 years ago

Thanks for letting me know, I will try a different method then

THHamiltonSmith commented 2 years ago

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: @.***>

foobar41 commented 2 years ago

All right, I will let you know soon.

THHamiltonSmith commented 2 years ago

Closing this for now until the time comes for the image conversion system to be revisited.

THHamiltonSmith commented 2 years ago

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

foobar41 commented 2 years ago

Sure, I'll give it a try

foobar41 commented 2 years ago

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

THHamiltonSmith commented 2 years ago

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

abhinav1912 commented 2 years ago

@THHamiltonSmith shouldn't the converted file be stored in something like a DynamoDB storage, where it will be purged after a given timeout?

foobar41 commented 2 years ago

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?

THHamiltonSmith commented 2 years ago

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.