在我的项目中,我使用Transloadit API实现图像上传,除了旋转之外,所有属性都可以正常工作。当我对旋转值进行硬编码时,它工作正常,上传的图像正确旋转。但是,当我尝试通过设置它的图像自动旋转rotation : true
它不起作用。我尝试了太多的图像,但它看起来像我的代码中有问题。这里是我的代码文件“的Index.html”:Transloadit - 图像自动旋转不起作用
<html>
<head><title>Title</title></head>
<body>
<form action="/image/upload.php" enctype="multipart/form-data" method="POST">
<input type="file" name="my_file" multiple="multiple" />
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://assets.transloadit.com/js/jquery.transloadit2-v2-latest.js"></script>
<script type="text/javascript">
$(function()
{
$('form').transloadit(
{
wait: true,
triggerUploadOnFileSelection: true,
params:
{
auth:
{
key: "MY_API_KEY"
},
steps:
{
thumb:
{
use: ":original",
robot: "/image/resize",
result: true,
rotation: true
}
}
}
});
});
</script>
</body>
</html>
我的PHP代码
<?php
$result = $_POST['transloadit'];
if (ini_get('magic_quotes_gpc') === '1')
{
$result = stripslashes($result);
}
$result = json_decode($result, true);
echo "<pre>";
print_r($result);
?>
请设置一个适当的问题与解释,你的问题是什么,什么工作,什么不是...代码片段是好的,但是,请不要只是说:“这是我所有的代码,请调试“。 –
嘿@Casimodo'sclone,我编辑了我的问题 –
干得好!它看起来更清楚支持者和任何遇到类似问题的人都能找到你的问题。 :)这就是为什么。我将在您的问题上提供一些修改以纠正轻微的打字错误。 –