• R/O
  • SSH
  • HTTPS

ptiblogphp: Commit


Commit MetaInfo

Revision52 (tree)
Time2021-07-06 22:36:34
Authormateuszviste

Log Message

configurable jpeg scaling

Change Summary

Incremental Difference

--- trunk/changes.txt (revision 51)
+++ trunk/changes.txt (revision 52)
@@ -9,6 +9,7 @@
99 - authentication form features a cancel link
1010 - UI can be easily localized through settings (defaults to english)
1111 - format and language of timestamps are configurable
12+ - configurable jpeg scaling ($RESIZEJPG_MAXWIDTH and $RESIZEJPG_MAXHEIGHT)
1213 - title string is properly htmlized (special characters escaped)
1314 - configurable timezone ($MYTIMEZONE)
1415 - upgraded dropzone.js from v5.7.0 to v5.9.2
--- trunk/index.php (revision 51)
+++ trunk/index.php (revision 52)
@@ -21,6 +21,8 @@
2121 $DATELOCALE = 'en_US';
2222 $TIMESTAMPFORMAT = 'written %A, %B %e, %Y at %H:%M';
2323 $MYTIMEZONE = '';
24+$RESIZEJPG_MAXWIDTH = '';
25+$RESIZEJPG_MAXHEIGHT = '';
2426 // lang
2527 $LANG_USERNAME = 'username';
2628 $LANG_PASSWORD = 'password';
@@ -309,7 +311,10 @@
309311 echo '<form action="./?artid=' . $artid . '&amp;action=uploadzdjecie" class="dropzone" id="formularzdropzone"></form>' . "\n";
310312 echo '<p class="admintool" style="text-align: center;"><a href="./?artid=' . $artid . '&amp;action=zdjecia">' . htmlentities($LANG_REFRESH) . '</a> <a href="' . PaginationLink($p, -1) . '">' . htmlentities($LANG_GOBACK) . '</a></p>' . "\n";
311313 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";
313318 $lista_plikow = ListaPlikow($artid, 0);
314319 foreach ($lista_plikow as $zd => $flaga_zdj) {
315320 $icon = 'svg/file.svg';
--- trunk/settings.php (revision 51)
+++ trunk/settings.php (revision 52)
@@ -7,6 +7,12 @@
77 $ADMINLOGIN = 'admin';
88 $ADMINPASS = '';
99
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+
1016 // you may enforce a specific timezone here so timestamps are displayed
1117 // according to your timezone instead of the web server's system timezone.
1218 // the timezone should be passed in the standard "IANA TZ DATABASE" format.
Show on old repository browser