Browse Source

add tz_seconds_to_offset function

main
Aaron Parecki 6 days ago
parent
commit
349f97a081
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      lib/helpers.php

+ 7
- 0
lib/helpers.php View File

@ -126,6 +126,9 @@ function micropub_media_post_for_user(&$user, $file) {
$r['location'] = false; $r['location'] = false;
} }
$parts = explode("\r\n\r\n", $r['response']);
$r['body'] = isset($parts[2]) ? $parts[2] : null;
return $r; return $r;
} }
@ -447,6 +450,10 @@ function validate_photo(&$file) {
} }
} }
function tz_seconds_to_offset($seconds) {
return ($seconds < 0 ? '-' : '+') . sprintf('%02d:%02d', abs($seconds/60/60), ($seconds/60)%60);
}
// Reads the exif rotation data and actually rotates the photo. // Reads the exif rotation data and actually rotates the photo.
// Only does anything if the exif library is loaded, otherwise is a noop. // Only does anything if the exif library is loaded, otherwise is a noop.
function correct_photo_rotation($filename) { function correct_photo_rotation($filename) {

Loading…
Cancel
Save