recalculate photo filesize when rotating an image
(cherry picked from commit f15e32d063)
			
			
This commit is contained in:
		| @@ -264,7 +264,7 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 						} | 						} | ||||||
| 	 | 	 | ||||||
| 						$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", | 						$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", | ||||||
| 						    dbesc(datetime_convert()), | 							dbesc(datetime_convert()), | ||||||
| 							dbescbin($data), | 							dbescbin($data), | ||||||
| 							intval($fsize), | 							intval($fsize), | ||||||
| 							intval($height), | 							intval($height), | ||||||
| @@ -278,10 +278,13 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 	 | 	 | ||||||
| 						$width  = $ph->getWidth(); | 						$width  = $ph->getWidth(); | ||||||
| 						$height = $ph->getHeight(); | 						$height = $ph->getHeight(); | ||||||
|  | 						$data = $ph->imageString(); | ||||||
|  | 						$fsize = strlen($data); | ||||||
| 	 | 	 | ||||||
| 						$x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", | 						$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", | ||||||
| 						    dbesc(datetime_convert()), | 							dbesc(datetime_convert()), | ||||||
| 							dbescbin($ph->imageString()), | 							dbescbin($data), | ||||||
|  | 							intval($fsize), | ||||||
| 							intval($height), | 							intval($height), | ||||||
| 							intval($width), | 							intval($width), | ||||||
| 							dbesc($resource_id), | 							dbesc($resource_id), | ||||||
| @@ -294,10 +297,13 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 	 | 	 | ||||||
| 						$width  = $ph->getWidth(); | 						$width  = $ph->getWidth(); | ||||||
| 						$height = $ph->getHeight(); | 						$height = $ph->getHeight(); | ||||||
|  | 						$data = $ph->imageString(); | ||||||
|  | 						$fsize = strlen($data); | ||||||
| 	 | 	 | ||||||
| 						$x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", | 						$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", | ||||||
| 						    dbesc(datetime_convert()), | 							dbesc(datetime_convert()), | ||||||
| 							dbescbin($ph->imageString()), | 							dbescbin($data), | ||||||
|  | 							intval($fsize), | ||||||
| 							intval($height), | 							intval($height), | ||||||
| 							intval($width), | 							intval($width), | ||||||
| 							dbesc($resource_id), | 							dbesc($resource_id), | ||||||
| @@ -310,10 +316,13 @@ class Photos extends \Zotlabs\Web\Controller { | |||||||
| 	 | 	 | ||||||
| 						$width  = $ph->getWidth(); | 						$width  = $ph->getWidth(); | ||||||
| 						$height = $ph->getHeight(); | 						$height = $ph->getHeight(); | ||||||
|  | 						$data = $ph->imageString(); | ||||||
|  | 						$fsize = strlen($data); | ||||||
| 	 | 	 | ||||||
| 						$x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", | 						$x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", | ||||||
| 						    dbesc(datetime_convert()), | 							dbesc(datetime_convert()), | ||||||
| 							dbescbin($ph->imageString()), | 							dbescbin($data), | ||||||
|  | 							intval($fsize), | ||||||
| 							intval($height), | 							intval($height), | ||||||
| 							intval($width), | 							intval($width), | ||||||
| 							dbesc($resource_id), | 							dbesc($resource_id), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user