- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Reddit Clone Series Ep 18 – Cropped Image with Canvas & React Image Crop Utils
In this episode of our Reddit Clone series, we extend the image cropping functionality using HTML canvas. We implement logic to extract the cropped portion of an image, convert it to a Blob and File, and update both the form data and the preview card. This ensures users can upload properly cropped banner and avatar images without losing quality.
Resources:
Buy me a coffee: buymeacoffee.com/bartingyo
Code Repository: https://github.com/bartingyo/reddit-clone/commit/0f40aa0480fbd837cde30062f7500eb51b3c3f8d
React Image Crop: https://www.npmjs.com/package/react-image-crop
Canvas DrawImage: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
Timeline:
00:00 – Intro & Save button plan
01:05 – Pseudo-code for canvas cropping workflow
03:40 – Convert percent crop → pixel crop with utility
09:30 – Render cropped image on canvas element
20:00 – Preserve resolution & prevent blurry output
25:16 – Convert canvas → Blob/File
31:30 – Update form fields & preview state
36:20 – Reset cropping & final Stage Two test
39:18 – Commit & wrap-up
🔔 Don't forget to like, comment, and subscribe for more web dev videos! If you have suggestions or run into issues, drop a comment below—let's solve it together! 🙌
Видео Reddit Clone Series Ep 18 – Cropped Image with Canvas & React Image Crop Utils канала Bartingyo
Resources:
Buy me a coffee: buymeacoffee.com/bartingyo
Code Repository: https://github.com/bartingyo/reddit-clone/commit/0f40aa0480fbd837cde30062f7500eb51b3c3f8d
React Image Crop: https://www.npmjs.com/package/react-image-crop
Canvas DrawImage: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
Timeline:
00:00 – Intro & Save button plan
01:05 – Pseudo-code for canvas cropping workflow
03:40 – Convert percent crop → pixel crop with utility
09:30 – Render cropped image on canvas element
20:00 – Preserve resolution & prevent blurry output
25:16 – Convert canvas → Blob/File
31:30 – Update form fields & preview state
36:20 – Reset cropping & final Stage Two test
39:18 – Commit & wrap-up
🔔 Don't forget to like, comment, and subscribe for more web dev videos! If you have suggestions or run into issues, drop a comment below—let's solve it together! 🙌
Видео Reddit Clone Series Ep 18 – Cropped Image with Canvas & React Image Crop Utils канала Bartingyo
Reddit Next.js TailwindCSS ShadCN Node.js Clone Hero Icons ui ux Storybook Stories React React.js Frontend Coding Programming Episode Series Step by step reactor schema constants form stage types preview card next handler arrow function banner avatar placeholder git commit state enum increment decrement form fields MIME MIME type image useState props error cropper react-image-crop npm package canvas blob file crop percentCrop
Комментарии отсутствуют
Информация о видео
20 сентября 2025 г. 4:00:51
00:39:38
Другие видео канала





















