webdevhub icon indicating copy to clipboard operation
webdevhub copied to clipboard

Create an image conversion system

Open THHamiltonSmith opened this issue 2 years ago • 15 comments

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

THHamiltonSmith avatar Jun 25 '22 13:06 THHamiltonSmith

Hi, I'd like to try this

foobar41 avatar Jun 26 '22 04:06 foobar41

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

THHamiltonSmith avatar Jun 26 '22 05:06 THHamiltonSmith

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

foobar41 avatar Jun 26 '22 17:06 foobar41

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

THHamiltonSmith avatar Jun 26 '22 17:06 THHamiltonSmith

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

foobar41 avatar Jun 26 '22 17:06 foobar41

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

THHamiltonSmith avatar Jun 26 '22 18:06 THHamiltonSmith

All right, I will let you know soon.

foobar41 avatar Jun 26 '22 18:06 foobar41

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

THHamiltonSmith avatar Jun 27 '22 13:06 THHamiltonSmith

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

THHamiltonSmith avatar Jul 05 '22 07:07 THHamiltonSmith

Sure, I'll give it a try

foobar41 avatar Jul 06 '22 05:07 foobar41

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 avatar Jul 15 '22 16:07 foobar41

@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 avatar Jul 15 '22 16:07 THHamiltonSmith

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

abhinav1912 avatar Aug 01 '22 14:08 abhinav1912

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?

foobar41 avatar Aug 11 '22 07:08 foobar41

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.

THHamiltonSmith avatar Aug 11 '22 08:08 THHamiltonSmith