-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_resizer.html
217 lines (141 loc) · 7.61 KB
/
image_resizer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<!-- Here used your icone or logo -->
<link rel="icon" href="imgvidoc.ico" type="image/x-icon">
<link rel="shortcut icon" href="imgvidoc.ico" type="image/x-icon">
<title>Image Resizer</title>
<script>
function resizeImage() {
// Get the input values from the user
var width = document.getElementById("width").value;
var height = document.getElementById("height").value;
// Get the image element
var image = document.getElementById("image");
// Set the new width and height of the image
image.style.width = width + "px";
image.style.height = height + "px";
// Create a canvas element and draw the resized image onto it
var canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
var context = canvas.getContext("2d");
context.drawImage(image, 0, 0, width, height);
// Convert the canvas element to a data URL and set it as the source of the download link
var downloadLink = document.getElementById("downloadLink");
downloadLink.href = canvas.toDataURL();
}
</script>
</head>
<body>
<!-- Header Top -->
<header class="text-gray-600 body-font">
<div class="container mx-auto flex flex-wrap p-5 flex-col md:flex-row items-center">
<a href=" index.html" <span class="ml-3 text-xl"><p style="color:rgba(4, 45, 250, 0.959)"> <b> Imgvidoc</b></p></span>
</a>
<!-- all link enter here-->
<nav href=" http://www.imgvidoc.website " class="md:ml-auto md:mr-auto flex flex-wrap items-center text-base justify-center">
<a href=" index.html" class="mr-5 hover:text-gray-900">Home</a>
<a href=" pdf.html" class="mr-5 hover:text-gray-900">Pdf</a>
<a href="youtube_video_downloader.html" class="mr-5 hover:text-gray-900">Youtube Video Downloader</a>
<a href="random-image.html" class="mr-5 hover:text-gray-900">Random Image</a>
<!-- Here link of home page -->
<a href="contact.html" class="mr-5 hover:text-gray-900">Contact</a>
</nav>
<a href="whatsapp://send?text= Image , PDF , random image generator and Youtube video download .Tools https://www.imgvidoc.website" class="inline-flex items-center bg-gray-100 border-0 py-1 px-3 focus:outline-none hover:bg-gray-200 rounded text-base mt-4 md:mt-0">Share
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-1" viewBox="0 0 24 24">
<path d="M5 12h14M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</header>
<!-- Image resize section-->
<center><h1><b> <p style="color:dodgerblue;font-size:30px">Image Resizer</p></b></h1> <br> <br>
</p>
<input type="file" id="fileInput" accept="image/*">
<b><label for="width">Width:</label> </b>
<input type="number" id="width" name="width" placeholder="Enter Width">
<b><label for="height">Height:</label></b>
<input type="number" id="height" name="height" placeholder="Enter Height">
<section class="text-gray-600 body-font">
<div class="container mx-auto flex px-5 py-24 items-center justify-center flex-col">
<div class="text-center lg:w-2/3 w-full">
<div class="flex justify-center">
<button onclick="resizeImage()" , Resize class="ml-3 inline-flex text-white bg-indigo-500 border-0 py-2 px-6 focus:outline-none hover:bg-indigo-700 rounded text-lg"> Resize</button>
</div>
</div>
</div>
</section>
<img id="image" src="#" alt="Uploaded Image" style="vertical-align:middle;margin:0px 100px"">
<section class="text-gray-600 body-font">
<div class="container mx-auto flex px-4 py-20 items-center justify-center flex-col">
<div class="text-center lg:w-2/3 w-full">
<div class="flex justify-center"> <!-- Enter your webside name -->
<button class="ml-3 inline-flex text-white bg-indigo-500 border-0 py-2 px-6 focus:outline-none hover:bg-indigo-700 rounded text-lg"> <a id="downloadLink" download="Imgvidoc.png">Download Resized Image</a> </button>
</div>
</div>
</div>
</section>
</center>
<!--
<button onclick="resizeImage()">Resize</button>
<a id="downloadLink" download="resized-image.png">Download Resized Image</a>
<br>
<br>
<img id="image" src="#" alt="Uploaded Image">
-->
<script>
var fileInput = document.getElementById("fileInput");
fileInput.addEventListener("change", function() {
var file = fileInput.files[0];
var reader = new FileReader();
reader.onload = function(event) {
var image = document.getElementById("image");
image.src = event.target.result;
};
reader.readAsDataURL(file);
});
</script>
<!-- Botton -->
<footer class="text-gray-600 body-font">
<div class="container px-5 py-8 mx-auto flex items-center sm:flex-row flex-col">
<a class="flex title-font font-medium items-center md:justify-start justify-center text-gray-900">
<!-- <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-10 h-10 text-white p-2 bg-indigo-500 rounded-full" viewBox="0 0 24 24">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg> -->
<span class="ml-3 text-xl"> <p style="color:rgba(4, 45, 250, 0.959)"><b> Imgvidoc</b></p></span>
</a>
<p class="text-sm text-gray-500 sm:ml-4 sm:pl-4 sm:border-l-2 sm:border-gray-200 sm:py-2 sm:mt-0 mt-4">© 2023 Imgvidoc —
<a href="https://in.linkedin.com/in/rishabh-kushwaha-308a29252" class="text-gray-600 ml-1" rel="noopener noreferrer" target="_blank">@rishabh</a>
</p>
<span class="inline-flex sm:ml-auto sm:mt-0 mt-4 justify-center sm:justify-start">
<a class="text-gray-500">
<svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<path d="M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-5 h-5" viewBox="0 0 24 24">
<rect width="20" height="20" x="2" y="2" rx="5" ry="5"></rect>
<path d="M16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zm1.5-4.87h.01"></path>
</svg>
</a>
<a class="ml-3 text-gray-500">
<svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="0" class="w-5 h-5" viewBox="0 0 24 24">
<path stroke="none" d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"></path>
<circle cx="4" cy="4" r="2" stroke="none"></circle>
</svg>
</a>
</span>
</div>
</footer>
</body>
</html>