前段时间,我写了一个方法,从一个在线社区上传的图片中读取EXIF数据。在我从图片中获得方向后,我将文件旋转到正确的方向。我的脚本中只有一小部分:
public function rotate($sourceFile, $targetFile, $orienation)
{
switch($orienation){
case 3: $degrees = '180'; break;
case 6: $degrees = '90'; break;
case 8: $degrees = '270';
我试图实现一个用户可以旋转图片的功能。我想为此使用RotateAnimation,如下所示:
rotateRight.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
//create a new bitmap that is rotated 90 deg
Matrix mat = new Matrix();
mat.postRotate(90);//90 degree rotation right
Bitmap bMapRota
看来我的轮换不起作用了。如果我手动执行logrotate,它会正常工作。运行logrotate是因为我可以在日志中看到它。这就是我所拥有的:
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
date
我不知道该怎么解决这个问题。 2019/01/14 05:15:02 [alert] 27307#27307: *9 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 108.162.226.175, server: titomi.cf, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock
目前,我正在使用OnImageCaptured回调来获取映像,而不是将其保存到设备中。当图像来自ImageProxy时,我很难理解什么时候需要旋转图像。
我使用以下方法将数据从ImageProxy转换为BitMap
...
val buffer: ByteBuffer = imageProxy.planes[0].buffer // Only first plane because of JPEG format.
val bytes = ByteArray(buffer.remaining())
buffer.get(bytes)
return BitmapFactory.decodeByte