• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32-Cam Photo-Manager Picture-Size

Q&A Forum › ESP32-Cam Photo-Manager Picture-Size
0 Vote Up Vote Down
uengel asked 4 years ago

Hi, I start with the Project “Photo-Manager” (eBook).
My question:

How can I adjust the image size (smaller) for the "ESP32-Cam 
PhotoManager" project so that the photo fits on the PC screen?

 

Thanks
4 Answers
0 Vote Up Vote Down
uengel answered 4 years ago

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
 
The easiest way to do that is to adjust the image size on the HTML.
 
In your code, search for the following:

<img src="saved-photo" id="photo" alt="Image not found: failed to open
image, image deleted or no microSD card inserted. Try refresh the page
or restart your board.">

Then, add the width and height attributes to set a fixed width and height. See the example on the following link to learn how to set width and height:

  • https://www.w3schools.com/tags/att_img_width.asp

 
So, in your code, you would have something as follows (replace the 500 and 600 with the appropriate values for you):

<img src="saved-photo" id="photo" width="500" height="600" alt="Image not found: failed to open
image, image deleted or no microSD card inserted. Try refresh the page
or restart your board.">

 
I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
uengel answered 4 years ago
Thank you for your quick response. Unfortunately, this was not the solution we were looking for, as the reduced photo was still drawn to full width. But with your tip I found the solution:
  <style>
    body {text-align: center; }
    .vert {margin-bottom: 25%; }
    .hori {margin-bottom: 0%; }
    img {height: auto; width: 80%; }
  </style>

I changed width: 80% . So it works now.

Many thanks and best regards Ulli
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Great!
I’m glad you found a solution.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.