Revision | 52 (tree) |
---|---|
Time | 2021-07-06 22:36:34 |
Author | ![]() |
configurable jpeg scaling
@@ -9,6 +9,7 @@ | ||
9 | 9 | - authentication form features a cancel link |
10 | 10 | - UI can be easily localized through settings (defaults to english) |
11 | 11 | - format and language of timestamps are configurable |
12 | + - configurable jpeg scaling ($RESIZEJPG_MAXWIDTH and $RESIZEJPG_MAXHEIGHT) | |
12 | 13 | - title string is properly htmlized (special characters escaped) |
13 | 14 | - configurable timezone ($MYTIMEZONE) |
14 | 15 | - upgraded dropzone.js from v5.7.0 to v5.9.2 |
@@ -21,6 +21,8 @@ | ||
21 | 21 | $DATELOCALE = 'en_US'; |
22 | 22 | $TIMESTAMPFORMAT = 'written %A, %B %e, %Y at %H:%M'; |
23 | 23 | $MYTIMEZONE = ''; |
24 | +$RESIZEJPG_MAXWIDTH = ''; | |
25 | +$RESIZEJPG_MAXHEIGHT = ''; | |
24 | 26 | // lang |
25 | 27 | $LANG_USERNAME = 'username'; |
26 | 28 | $LANG_PASSWORD = 'password'; |
@@ -309,7 +311,10 @@ | ||
309 | 311 | echo '<form action="./?artid=' . $artid . '&action=uploadzdjecie" class="dropzone" id="formularzdropzone"></form>' . "\n"; |
310 | 312 | echo '<p class="admintool" style="text-align: center;"><a href="./?artid=' . $artid . '&action=zdjecia">' . htmlentities($LANG_REFRESH) . '</a> <a href="' . PaginationLink($p, -1) . '">' . htmlentities($LANG_GOBACK) . '</a></p>' . "\n"; |
311 | 313 | echo '<script src="./dropzone592/dropzone.min.js"></script>' . "\n"; |
312 | - echo '<script>Dropzone.options.formularzdropzone = {resizeWidth: 1600, resizeHeight: 1200, dictDefaultMessage: "' . $LANG_DROPFILESHERE . '"};</script>' . "\n"; | |
314 | + echo '<script>Dropzone.options.formularzdropzone = {'; | |
315 | + if (!empty($RESIZEJPG_MAXWIDTH)) echo 'resizeWidth: ' . intval($RESIZEJPG_MAXWIDTH) . ', '; | |
316 | + if (!empty($RESIZEJPG_MAXHEIGHT)) echo 'resizeHeight: ' . intval($RESIZEJPG_MAXHEIGHT) . ', '; | |
317 | + echo 'dictDefaultMessage: "' . $LANG_DROPFILESHERE . '"};</script>' . "\n"; | |
313 | 318 | $lista_plikow = ListaPlikow($artid, 0); |
314 | 319 | foreach ($lista_plikow as $zd => $flaga_zdj) { |
315 | 320 | $icon = 'svg/file.svg'; |
@@ -7,6 +7,12 @@ | ||
7 | 7 | $ADMINLOGIN = 'admin'; |
8 | 8 | $ADMINPASS = ''; |
9 | 9 | |
10 | +// when a big jpeg picture is being uploaded, ptiblogphp automatically | |
11 | +// scales it down to the limits set below. if you comment out these settings, | |
12 | +// then no scaling will be applied. | |
13 | +$RESIZEJPG_MAXWIDTH = 1600; | |
14 | +$RESIZEJPG_MAXHEIGHT = 1200; | |
15 | + | |
10 | 16 | // you may enforce a specific timezone here so timestamps are displayed |
11 | 17 | // according to your timezone instead of the web server's system timezone. |
12 | 18 | // the timezone should be passed in the standard "IANA TZ DATABASE" format. |