Commit Graph

85 Commits

Author SHA1 Message Date
Klaus Weidenbach
e6dadb215e Refactor photo_driver to use namespaces.
Add simple UnitTest, but it is not yet very meaningful.
2019-02-14 22:06:42 +01:00
Klaus Weidenbach
d70bba2806 Clean up and documentation in photo_drive. 2019-02-14 22:06:42 +01:00
Mario Vavti
b93bc142d3 missing closing parenthesis 2019-01-03 19:18:49 +01:00
Mario Vavti
ab9b8b8b0a fix content type check 2019-01-03 19:13:56 +01:00
Max Kostikov
3bf1866f4a Revert "Merge branch 'check_content_type' into 'dev'"
This reverts merge request !1453
2019-01-03 17:13:40 +01:00
Mario Vavti
f3f106c21f check suppported type if we get content type from header 2019-01-02 17:49:21 +01:00
Mario Vavti
993db01400 return on readImageBlob() exception 2018-12-11 12:21:09 +01:00
Mario Vavti
2173ef5fb6 catch exception if readImageBlob() receives bogus data
(cherry picked from commit 443d7684db)
2018-12-03 10:48:39 +01:00
Max Kostikov
c165894ce9 Add Expires field support 2018-12-03 00:51:09 +01:00
Max Kostikov
19903ea3c1 Add flag to allow to save image without validation 2018-12-02 21:59:08 +01:00
Mario Vavti
4812c5486d strlen($this->imageString()) does not return the correct size when dealing with os_storage images. use filesize() instead.
(cherry picked from commit afc75af62f)
2018-11-16 22:19:01 +01:00
Max Kostikov
a49cfa8142 Update photo_driver.php 2018-11-10 20:45:20 +01:00
Max Kostikov
d34423fce9 Fixed wrong value assign on compare with 0 2018-11-10 11:53:49 +01:00
Max Kostikov
32873ce70d Preserve received image modification date on caching 2018-11-09 22:20:41 +01:00
Max Kostikov
098ec1abb4 remove image type double guess by checking HTTP headers 2018-11-08 22:43:17 +01:00
Max Kostikov
17cf824545 Return image modification date using HTTP 'Last-Modified' and '304 Not Modified' on remote fetch for caching 2018-11-08 18:00:18 +01:00
zotlabs
55dc6fbc1c imagemagick preserves exif when scaling. GD does not. We do not want to preserve exif on thumbnails which we have rotated, as a browser reading the exif information could rotate them yet again. This checkin adds an abstract function to the generic photo driver which makes the behaviour consistent by stripping EXIF from imagick processed images. However, we will attempt to preserve any ICC colour profiles. See http://php.net/manual/en/imagick.stripimage.php 2018-04-22 18:12:16 -07:00
zotlabs
0905018d3b use original exif_read_data() parameters which were lost in a regression; unset automatic nsfw category generated for Mastodon content warning posts, as people use CW as a spoiler mechanism 99% of the time and flagging inappropriate content 1% of the time. 2018-03-14 14:51:33 -07:00
zotlabs
128d1f7aa8 somewhere along the line the output of exif_read_data() changed and it no longer provides populated sections. Adjust for the new format and allow for the old because I cannot find documentation of this change anywhere. This affects photo rotation and the photo map feature. 2018-03-13 22:47:11 -07:00
zotlabs
b4f8f4df7b allow toggle to 'SMBC' scaling mode. 'SMBC' mode is named thusly for Saturday Morning Breakfast Cereal cartoons which are very tall. If you scale the image to constrain both dimensions, the cartoon text is illegible. So we allow the height to float and only constrain the width. The new flag allows you to overide this mode and force both dimensions to always be evaluated and constrained to the provided limit. 2017-11-21 19:47:59 -08:00
zotlabs
16f584608f text thumbnails in cloud tile mode 2017-11-19 16:56:59 -08:00
zotlabs
8e53491867 sort out a few more large image upload issues 2017-11-14 17:39:33 -08:00
zotlabs
d6b1eff70e ensure we have an observer hash 2017-10-03 17:05:32 -07:00
zotlabs
7fb02752de hubzilla issue #868 2017-10-03 17:03:24 -07:00
zotlabs
9e46472ca2 provide default photo mimetype 2017-09-20 00:00:26 -07:00
zotlabs
1c0ece8411 provide a hook for importing a channel photo at channel creation time 2017-09-14 18:48:55 -07:00
zotlabs
5686901869 some doco fixes and other real minor stuff to improve logreading ability 2017-08-09 22:45:52 -07:00
zotlabs
21542d1f9e guess_image_type - ignore scheme when checking for urls 2017-06-25 18:09:34 -07:00
zotlabs
07d6472eea mastodon reshares can be either posts or comments; silence warning from guess_image_type when handed a URL to a non-existent resource. 2017-06-25 18:07:07 -07:00
zotlabs
83f8f8ebb8 whitespace 2017-06-05 15:57:43 -07:00
zotlabs
cdfcb1ed24 cleanup only 2017-05-31 22:59:07 -07:00
zotlabs
65e5894363 photo size-0 issue 2017-04-07 14:56:12 -07:00
zotlabs
fa89b8f66d add os_path and display_path to photos, fix some issues with multiple path separators after cloud/nickname in the content field of attach and photos 2017-03-14 22:02:28 -07:00
Mario Vavti
a36d74dad5 do not choke if photo_factory() returns null 2017-01-15 13:23:28 +01:00
zotlabs
21b919a76b correct encoding 2016-10-23 19:04:42 -07:00
zotlabs
9bb847bb07 remove the rest of the backticks from sql queries; replace with TQUOT const which is driver dependent 2016-10-12 18:15:12 -07:00
redmatrix
7b90b0dfd9 issue #526 2016-09-22 17:08:16 -07:00
redmatrix
007836f514 issue #519 2016-09-20 15:38:11 -07:00
redmatrix
a9d7acda27 the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files. 2016-06-01 21:48:54 -07:00
redmatrix
80f2ba640e code cleanup 2016-05-24 20:49:23 -07:00
redmatrix
1cd3b41825 deprecate $a->get_baseurl() 2016-03-30 22:13:24 -07:00
redmatrix
9584ca080c some initial work on uploading and cropping cover photos 2016-01-13 17:32:09 -08:00
redmatrix
22a650ade8 issue #154 2015-11-12 16:57:02 -08:00
Mario Vavti
7ce3ebc46d make sure we only have one profile photo for a cloned channel 2015-11-01 21:04:55 +01:00
Mario Vavti
f8b767ed32 fix photo item for search_item.tpl and a minor css fix 2015-10-30 18:46:16 +01:00
Mario Vavti
d66be62516 move it up 2015-10-29 11:34:30 +01:00
Mario Vavti
0a9b2b6b15 possibly better fox for profil photo image type issue 2015-10-29 11:29:11 +01:00
Mario Vavti
a5f1fa3168 re-enable pathinfo() check and try with getimagesize() if we have not got a result 2015-10-28 21:52:15 +01:00
Mario Vavti
1375ed6aea pathinfo() does not work in this case. getimagesize() seems more reliabel. this fixes transparent png avatars having a black background. 2015-10-28 20:01:50 +01:00
redmatrix
9ab335626c import_xchan_photo: check the return headers to ensure it's an image content-type of some form as imagick chucks a wobbly if you try to initialise an image with an html error page. 2015-09-26 13:25:34 -07:00