Commit graph

62 commits

Author SHA1 Message Date
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
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
redmatrix
6cc60ba477 initial work on obj import, rename import_profile_photo to import_xchan_photo to more accurately state its purpose. 2015-09-01 22:03:10 -07:00
redmatrix
69920fb717 fix photo location 2015-08-19 19:17:17 -07:00
redmatrix
c90f14c066 Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts:
	doc/to_do_code.bb
2015-07-21 17:13:48 -07:00
Mario Vavti
4d45bc9da1 Fixes regarding the new default profile photo size. The default profile photos are just renamed. People which provided the originals are invited to reproduce them in the new 300 by 300 px format. 2015-07-20 21:01:11 +02:00
redmatrix
86588bdd6c more work on photos, including os_storage for the size '0' photo and numbering duplicate filenames 2015-06-23 22:46:39 -07:00
redmatrix
c11b1f8b0d vsprintf error 2015-05-18 22:07:38 -07:00
redmatrix
da7abbb089 bring the new photo schema into play 2015-05-18 19:43:53 -07:00
friendica
7c194c37b8 started to add the ability to geotag photos (default will be disabled) but my phone isn't outputting the GPS tags even after being explicitly enabled so I'll have to wait until I've got a device that I can reliably test against. 2015-03-16 20:08:05 -07:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
habeascodice
c854f8c238 Revert "x"
This reverts commit f84453497b.
2014-10-11 05:44:31 -07:00
habeascodice
7a106cf60c Merge remote branch 'upstream/master' 2014-10-09 01:06:59 -07:00
nostupidzone
9d5129de34 put back local file check so body is fetched from z_ functions 2014-10-07 23:59:26 -07:00
habeascodice
737a3362d5 Merge remote branch 'upstream/master' 2014-10-07 22:35:02 -07:00
habeascodice
f84453497b x 2014-10-07 22:34:30 -07:00
friendica
ee6c53c2e5 add imagick version check when guessing mimetype. It probably isn't important here, but let's make sure we have the right driver installed if we do something else with photos afterward. 2014-10-07 21:16:30 -07:00
friendica
14d538c793 check the imagick version before using it. 2014-10-07 15:14:06 -07:00
nostupidzone
60a89670f6 add ability to skip broken imagemagick on shared hosting 2014-10-07 09:54:27 -07:00
Jeroen
a17eae941b image/jpeg > image/png 2014-10-05 21:38:47 +00:00
friendica
eb38f3f474 support title and description (and dates which were done earlier) for friendica photo import 2014-08-13 16:34:36 -07:00
friendica
041aff36b7 provide a way to preserve photo timestamps when importing (rather than uploading) 2014-08-12 21:51:32 -07:00