Commit graph

34 commits

Author SHA1 Message Date
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
5547222da2 add gif to supported image types (if it's supported) 2014-09-11 15:50:35 -07: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
friendica
769b0f6bc9 Often somebody will join the matrix with a dodgy cert and we'll sort that out but their profile photo will remain rainbow man (or the site default). However the photo_date has been updated so we won't try again. This checkin looks for such a failure and leaves the photo_date alone if the photo import failed. 2014-04-13 18:30:06 -07:00
friendica
08b571c9d0 project "snakebite" 2014-02-17 14:30:02 -08:00
friendica
bf8e73ca73 missing filename in uploaded photos (we don't really use this, but we will need to have a filename to export via DAV or API and the original filename would be the most likely choice). 2014-01-22 23:54:14 -08:00
friendica
530adb50ee sql error 2014-01-21 00:40:45 -08:00
friendica
c95909921e auto-crop imported photos for things and xchans. This results in undistorted images but may result in cropping important parts of the picture. Still this will work well for 95 out of 100 cases. If the width exceeds the height by greater than 1.2 we will remove an equal margin from either side of the photo leaving the center intact. If the height exceeds the width we will chop off the bottom to make it square. This is good for most single person photographs, unless the object of interest is off-center horizontally in a wide photo - or one is trying to emphasize aspects of human anatomy which may be at the bottom of a tall photo. 2013-12-30 21:41:13 -08:00
friendica
1d0fddd39c things can now have (consistent sized) photos - plus I found a couple of issues with duplicate notifications and contact photos not getting an album name (it was crossed with filename). The last one doesn't matter as neither is used, but it was wrong so it has been corrected. Oh and thing photos weren't working at all because the form element name was different than what the module was looking for. But that had never been tested as I was waiting to get the import/resize finished. Next up for that module is display and deletion of things; but the priority is pretty low. 2013-12-28 13:28:49 -08:00
friendica
7c81889b33 make default profile photo configurable - should be functional but needs admin ui 2013-12-19 16:33:36 -08:00
friendica
75ebf06131 some work on modularising the default profile photo so we can make them site selectable. Also red != friendica so we don't need all these friendica logos taking up space 2013-12-09 14:05:52 -08:00
friendica
bd33e0486d deprecate a->get_curl_code() and $a->get_curl_headers() 2013-12-01 00:16:02 -08:00
friendica
20b22421d3 big changes to photo->store() which is now photo->save() and takes an array instead of a list of args. Also the beginning of the migration to using photo_flags to indicate special purpose photos such as profile photos and contact photos and "thing" photos. 2013-08-07 01:42:45 -07:00
friendica
10f016841c cleaning up issues reported in logs 2013-07-28 18:54:40 -07:00
friendica
524f205caa photo driver issue when updating contact photos - old class structure used instead of photo_factory() 2013-05-05 22:49:46 -07:00
friendica
d63de4dbe2 don't try and load an empty string as a photo 2013-04-29 19:52:31 -07:00
friendica
72e83f69bc photo driver abstraction 2013-04-25 20:01:24 -07:00