kezdetleges képkorrekció beépítve
This commit is contained in:
parent
87463e3a90
commit
626821ed9a
13
index.php
13
index.php
@ -50,7 +50,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section class="upload-popup-inner-container" id="infoform">
|
<section class="upload-popup-inner-container" id="infoform">
|
||||||
<section style="margin: 3em 0em;">
|
<section style="margin: 0em 0em;">
|
||||||
<label for="author">Alkotó:*</label><br>
|
<label for="author">Alkotó:*</label><br>
|
||||||
<input type="text" id="author" style="width: 440px;" placeholder="Arthur Dent"><br><br>
|
<input type="text" id="author" style="width: 440px;" placeholder="Arthur Dent"><br><br>
|
||||||
<label for="imgtitle">Cím:*</label><br>
|
<label for="imgtitle">Cím:*</label><br>
|
||||||
@ -58,7 +58,16 @@
|
|||||||
<label for="description">Leírás:</label><br>
|
<label for="description">Leírás:</label><br>
|
||||||
<textarea id="description" style="width: 440px; height: 5em;"
|
<textarea id="description" style="width: 440px; height: 5em;"
|
||||||
placeholder="A válasz az életet, a világmindenséget, meg mindent érintő kérdésre."></textarea><br><br>
|
placeholder="A válasz az életet, a világmindenséget, meg mindent érintő kérdésre."></textarea><br><br>
|
||||||
<input type="checkbox" id="respchkbox">A feltöltött tartalmamért <i>teljes</i> felelősséget vállalok.
|
<input type="checkbox" id="autocorrchkbox">Kérek automatikus képkorrekciót! (expozíció, élesítés)<br><br>
|
||||||
|
<input type="checkbox" id="respchkbox">A feltöltött tartalmamért <i>teljes</i> felelősséget vállalok.<br><br>
|
||||||
|
</section>
|
||||||
|
<section style="text-align: right;">
|
||||||
|
<section class="btn" onclick="publish()" id="publishbtn">Mehet!</section>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section class="upload-popup-inner-container" id="imgcorrection">
|
||||||
|
<section style="margin: 3em 0em;">
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
<section style="text-align: right;">
|
<section style="text-align: right;">
|
||||||
<section class="btn" onclick="publish()" id="publishbtn">Mehet!</section>
|
<section class="btn" onclick="publish()" id="publishbtn">Mehet!</section>
|
||||||
|
@ -123,15 +123,25 @@ function publish_image($artwork_details)
|
|||||||
// nagyméretű kép elkészítése
|
// nagyméretű kép elkészítése
|
||||||
$large_filename = PUBLISHED_DIR . DIRECTORY_SEPARATOR . $final_filename;
|
$large_filename = PUBLISHED_DIR . DIRECTORY_SEPARATOR . $final_filename;
|
||||||
|
|
||||||
|
// korrekciós parancs
|
||||||
|
$autocorrect = $artwork_details["autocorrect"];
|
||||||
|
$img_autocorrect = $autocorrect ? "-normalize -sharpen 5" : "";
|
||||||
|
|
||||||
// ha a fájl nagyobb, mint 2MB, akkor visszatömörítjük
|
// ha a fájl nagyobb, mint 2MB, akkor visszatömörítjük
|
||||||
$filesize = filesize($incoming_filename);
|
$filesize = filesize($incoming_filename);
|
||||||
if ($filesize > $MAX_LARGE_IMAGE_FILESIZE) {
|
if ($filesize > $MAX_LARGE_IMAGE_FILESIZE) {
|
||||||
$cmd = "convert -define jpeg:extent=$MAX_LARGE_IMAGE_FILESIZE_STR $incoming_filename $large_filename";
|
$cmd = "convert -define jpeg:extent=$MAX_LARGE_IMAGE_FILESIZE_STR $img_autocorrect $incoming_filename $large_filename";
|
||||||
shell_exec($cmd);
|
shell_exec($cmd);
|
||||||
unlink($incoming_filename); // törlés az incoming-ból
|
unlink($incoming_filename); // törlés az incoming-ból
|
||||||
} else { //...ha nem volt túl nagy a fájl
|
} else { //...ha nem volt túl nagy a fájl
|
||||||
|
if ($autocorrect) {
|
||||||
|
$cmd = "convert $img_autocorrect $incoming_filename $large_filename";
|
||||||
|
shell_exec($cmd);
|
||||||
|
unlink($incoming_filename); // törlés az incoming-ból
|
||||||
|
} else {
|
||||||
shell_exec("mv $incoming_filename $large_filename");
|
shell_exec("mv $incoming_filename $large_filename");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// bélyegkép elkészítése
|
// bélyegkép elkészítése
|
||||||
$thumb_filename = THUMBNAIL_DIR . DIRECTORY_SEPARATOR . $final_filename;
|
$thumb_filename = THUMBNAIL_DIR . DIRECTORY_SEPARATOR . $final_filename;
|
||||||
|
@ -41,6 +41,7 @@ function pup_reset() {
|
|||||||
reset_slider(slider_id); // slider visszaállítása
|
reset_slider(slider_id); // slider visszaállítása
|
||||||
o(publish_btn_id).innerText = "Mehet!"; // gombfelirat visszaállítása
|
o(publish_btn_id).innerText = "Mehet!"; // gombfelirat visszaállítása
|
||||||
o("respchkbox").checked = false; // pipa kivétele
|
o("respchkbox").checked = false; // pipa kivétele
|
||||||
|
o("autocorrchkbox").checked = false;
|
||||||
|
|
||||||
// mezők törlése
|
// mezők törlése
|
||||||
o("author").value = "";
|
o("author").value = "";
|
||||||
@ -58,6 +59,7 @@ function publish() {
|
|||||||
let author = o("author").value;
|
let author = o("author").value;
|
||||||
let title = o("imgtitle").value;
|
let title = o("imgtitle").value;
|
||||||
let desc = o("description").value;
|
let desc = o("description").value;
|
||||||
|
let autocorr = o("autocorrchkbox").checked;
|
||||||
|
|
||||||
// ha a kötelező mezők nincsenek kitöltve, akkor nem lehet beküldeni
|
// ha a kötelező mezők nincsenek kitöltve, akkor nem lehet beküldeni
|
||||||
if (author.trim() === "" || title.trim() === "") {
|
if (author.trim() === "" || title.trim() === "") {
|
||||||
@ -75,7 +77,8 @@ function publish() {
|
|||||||
uid: image_uid,
|
uid: image_uid,
|
||||||
author: author,
|
author: author,
|
||||||
title: title,
|
title: title,
|
||||||
desc: desc
|
desc: desc,
|
||||||
|
autocorrect: autocorr
|
||||||
}
|
}
|
||||||
|
|
||||||
// küldés
|
// küldés
|
||||||
@ -87,11 +90,10 @@ function publish() {
|
|||||||
|
|
||||||
req.onreadystatechange = state => {
|
req.onreadystatechange = state => {
|
||||||
if (req.status === 200 && req.readyState === 4) {
|
if (req.status === 200 && req.readyState === 4) {
|
||||||
pup_reset(); // popup resetelése
|
close_upload_pup(); // popup resetelése
|
||||||
|
|
||||||
if (Number(req.response) === 0) {
|
if (Number(req.response) === 0) {
|
||||||
alert("Sikeres feltöltés!");
|
alert("Sikeres feltöltés!");
|
||||||
close_upload_pup();
|
|
||||||
} else if (Number(req.response) === -1) {
|
} else if (Number(req.response) === -1) {
|
||||||
alert("Ugyanezt képet már korábban feltöltötték!");
|
alert("Ugyanezt képet már korábban feltöltötték!");
|
||||||
} else {
|
} else {
|
||||||
@ -585,6 +587,7 @@ function init_viewer() {
|
|||||||
viewer_original_offset_coords = img.offset;
|
viewer_original_offset_coords = img.offset;
|
||||||
viewer_original_mouse_coords = { x: t[0].screenX, y: t[0].screenY };
|
viewer_original_mouse_coords = { x: t[0].screenX, y: t[0].screenY };
|
||||||
viewer_grabbing = true;
|
viewer_grabbing = true;
|
||||||
|
last_touch_distance = 0;
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
img.addEventListener("touchmove", (e) => {
|
img.addEventListener("touchmove", (e) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user