び2
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Image Viewer</title>
</head>
<body>
<h1>Image Viewer</h1>
<form method="POST" enctype="multipart/form-data">
<input type="file" name="photo">
<input type="submit" value="Upload">
</form>
{% if filename %}
<h2>Original Image:</h2>
<img src="{{ url_for('send_file', filename=filename) }}" alt="Original Image">
<form method="POST" action="/process">
<input type="hidden" name="filename" value="{{ filename }}">
<label for="mode">Mode:</label>
<select name="mode">
<option value="RGB">RGB</option>
<option value="Grayscale">Grayscale</option>
</select>
<label for="r">R:</label>
<input type="range" name="r" min="0" max="255" value="255">
<label for="g">G:</label>
<input type="range" name="g" min="0" max="255" value="255">
<label for="b">B:</label>
<input type="range" name="b" min="0" max="255" value="255">
<input type="submit" value="Process">
</form>
<form method="POST" action="/save">
<input type="hidden" name="filename" value="{{ filename }}">
<input type="submit" value="Save to S3">
</form>
<h2>Processed Image:</h2>
<img src="{{ url_for('send_file', filename='processed_' + filename) }}" alt="Processed Image">
{% endif %}
</body>
</html>