Merge git://github.com/friendica/friendica
This commit is contained in:
commit
d20cdf09ea
13 changed files with 1254 additions and 661 deletions
|
|
@ -121,7 +121,70 @@ class Photo {
|
|||
$this->image = imagerotate($this->image,$degrees,0);
|
||||
$this->width = imagesx($this->image);
|
||||
$this->height = imagesy($this->image);
|
||||
}
|
||||
}
|
||||
|
||||
public function flip($horiz = true, $vert = false) {
|
||||
$w = imagesx($this->image);
|
||||
$h = imagesy($this->image);
|
||||
$flipped = imagecreate($w, $h);
|
||||
if($horiz) {
|
||||
for ($x = 0; $x < $w; $x++) {
|
||||
imagecopy($flipped, $this->image, $x, 0, $w - $x - 1, 0, 1, $h);
|
||||
}
|
||||
}
|
||||
if($vert) {
|
||||
for ($y = 0; $y < $h; $y++) {
|
||||
imagecopy($flipped, $this->image, 0, $y, 0, $h - $y - 1, $w, 1);
|
||||
}
|
||||
}
|
||||
$this->image = $flipped;
|
||||
}
|
||||
|
||||
public function orient($filename) {
|
||||
// based off comment on http://php.net/manual/en/function.imagerotate.php
|
||||
|
||||
if(! function_exists('exif_read_data'))
|
||||
return;
|
||||
|
||||
$exif = exif_read_data($filename);
|
||||
$ort = $exif['Orientation'];
|
||||
|
||||
switch($ort)
|
||||
{
|
||||
case 1: // nothing
|
||||
break;
|
||||
|
||||
case 2: // horizontal flip
|
||||
$this->flip();
|
||||
break;
|
||||
|
||||
case 3: // 180 rotate left
|
||||
$this->rotate(180);
|
||||
break;
|
||||
|
||||
case 4: // vertical flip
|
||||
$this->flip(false, true);
|
||||
break;
|
||||
|
||||
case 5: // vertical flip + 90 rotate right
|
||||
$this->flip(false, true);
|
||||
$this->rotate(-90);
|
||||
break;
|
||||
|
||||
case 6: // 90 rotate right
|
||||
$this->rotate(-90);
|
||||
break;
|
||||
|
||||
case 7: // horizontal flip + 90 rotate right
|
||||
$this->flip();
|
||||
$this->rotate(-90);
|
||||
break;
|
||||
|
||||
case 8: // 90 rotate left
|
||||
$this->rotate(90);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ function notification($params) {
|
|||
if($params['type'] == NOTIFY_TAGSELF) {
|
||||
$subject = sprintf( t('[Friendica:Notify] %s tagged you') , $params['source_name']);
|
||||
$preamble = sprintf( t('%1$s tagged you at %2$s') , $params['source_name'], $sitename);
|
||||
$epreamble = sprintf( t('%1$s [url=%2s]tagged you[/url].') ,
|
||||
$epreamble = sprintf( t('%1$s [url=%2$s]tagged you[/url].') ,
|
||||
'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]',
|
||||
$params['link']);
|
||||
|
||||
|
|
|
|||
|
|
@ -814,6 +814,12 @@ function item_store($arr,$force_parent = false) {
|
|||
if($r[0]['private'])
|
||||
$arr['private'] = 1;
|
||||
|
||||
// Edge case. We host a public forum that was originally posted to privately.
|
||||
// The original author commented, but as this is a comment, the permissions
|
||||
// weren't fixed up so it will still show the comment as private unless we fix it here.
|
||||
|
||||
if((intval($r[0]['forum_mode']) == 1) && (! $r[0]['private']))
|
||||
$arr['private'] = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue