title: How do I store images into my persistent storage? Where do I encode and decode it? How do I display it using Jinja in HTML?
body: <p>I am unsure how should I used base64 to encode and decode my image, as well as where should I place the codes for encoding and decoding at. I am also unsure of how should I display it in Jinja Html.</p>
  
  <p>I have already tried encoding my image but I am unsure whether I did the right way or not. I have also tried to decode it but it can seem to run my program.</p>
  
  <h1>main.py</h1>
  
  <p><code>@app.route('/camera', methods = ['GET', 'POST'])
  </code>def camera():</p>
  
  <pre><code>``list = []
  ``with shelve.open('PerStorageCamera.db') as d:
      `enter code here`for key in d:
          `enter code here`for i in d[key]:
              `enter code here`list.append(i)
  
  ``form = FormSelect1(request.form)
  ``form1 = FormSelect2(request.form)
  ``location_data = form.location.data
  
  ``return render_template('camera.html', form=form, form1 = form1, location_data = location_data, list = list)
  </code></pre>
  
  <h1>part of my codes for my class</h1>
  
  <p>``class Cameras:</p>
  
  <pre><code>``wdlands = []
  
  ``def __init__(self, location, camera):
      ``self.__location = location
      ``self.__camera = camera
      ``self.add()
  
  ``def get_location(self):
      ``return self.__location
  
  ``def get_camera(self):
      ``return self.__camera
  
  ``def add(self):
      ``if self.__location == 'wdlands':
          ``self.__class__.wdlands.append(self)
  </code></pre>
  
  <h1>objects created to append into persistent storage</h1>
  
  <p><code>wdlands1 = Cameras('wdlands', 'Woodlands Causeway (Towards Johor)')
  </code>wdlands2 = Cameras('wdlands', 'Woodlands Checkpoint (Towards BKE)')</p>
  
  <h1>.html</h1>
  
  <p>``{% for i in list %}</p>
  
  <p>``{% if location_data == "wdlands" %}</p>
  
  <p><code>{% if i.get_location() == "wdlands" %}
  </code>
                     <code>&lt;tr&gt;&lt;th&gt;Camera: &lt;/th&gt;&lt;td&gt;{{ i.get_camera() }}&lt;/td&gt;&lt;/tr&gt;
  </code></p>
  
  <pre><code>          ``&lt;form action= "http://localhost:5000/myjourney" method= "get"&gt;
                   {{ form.submit }}
            ``&lt;/form&gt;
            ``&lt;br&gt;
       ``{% endif %}`
  </code></pre>
  
  <p>I am expecting to have different images for each of my objects that is appended into the persistent storage</p>