}
};
- native_.call('ExifManager_getExifInfo', {'uri': args.uri}, callback);
+ var result = native_.call('ExifManager_getExifInfo', {'uri': args.uri}, callback);
+
+ if (native_.isFailure(result)) {
+ // since tizen 5.0 the only possible error type here is SecurityError
+ throw native_.getErrorObject(result);
+ }
};
ExifManager.prototype.saveExifInfo = function() {
}
};
- native_.call('ExifManager_saveExifInfo', json, callback);
+ var result = native_.call('ExifManager_saveExifInfo', json, callback);
+
+ if (native_.isFailure(result)) {
+ // since tizen 5.0 the only possible error type here is SecurityError
+ throw native_.getErrorObject(result);
+ }
};
ExifManager.prototype.getThumbnail = function() {
}
};
- native_.call('ExifManager_getThumbnail', {'uri': args.uri}, _callback);
+ var result = native_.call('ExifManager_getThumbnail', {'uri': args.uri}, _callback);
+
+ if (native_.isFailure(result)) {
+ // since tizen 5.0 the only possible error type here is SecurityError
+ throw native_.getErrorObject(result);
+ }
};
tizen.ExifInformation = function(exifInitDict) {
#include "common/platform_result.h"
#include "common/task-queue.h"
#include "common/tools.h"
+#include "common/filesystem/filesystem_provider.h"
#include "exif/exif_information.h"
#include "exif/exif_util.h"
ScopeLogger();
const std::string& uri = args.get("uri").get<std::string>();
+ const std::string& file_path = ExifUtil::convertUriToPath(uri);
const double callback_id = args.get("callbackId").get<double>();
+ const std::string& real_path = common::FilesystemProvider::Create().GetRealPath(file_path);
+
+ CHECK_STORAGE_ACCESS(real_path, &out);
+
auto get = [=](const std::shared_ptr<JsonValue>& response) -> void {
ScopeLogger("Entered into asynchronous function, get");
JsonValue result = JsonValue(JsonObject());
PlatformResult status(ErrorCode::NO_ERROR);
- const std::string& file_path = ExifUtil::convertUriToPath(uri);
-
PlatformResult fileAvailability(common::tools::CheckFileAvailability(file_path));
if (!fileAvailability) {
LogAndReportError(fileAvailability, &response->get<picojson::object>());
ScopeLogger();
const double callback_id = args.get("callbackId").get<double>();
+
+ const std::string& file_uri = args.get("uri").get<std::string>();
+ const std::string& file_path = ExifUtil::convertUriToPath(file_uri);
+ const std::string& real_path = common::FilesystemProvider::Create().GetRealPath(file_path);
+
+ CHECK_STORAGE_ACCESS(real_path, &out);
+
auto get = [=](const std::shared_ptr<JsonValue>& response) -> void {
ScopeLogger("Entered into asynchronous function, get");
JsonValue result = JsonValue(JsonObject());
PlatformResult status(ErrorCode::NO_ERROR);
ExifInformationPtr exifInfo(new ExifInformation(args));
- const std::string& uri = exifInfo->getUri();
- const std::string& path = ExifUtil::convertUriToPath(uri);
- status = exifInfo->saveToFile(path);
+ status = exifInfo->saveToFile(file_path);
if (status)
ReportSuccess(result, response->get<picojson::object>());
ScopeLogger();
const std::string& uri = args.get("uri").get<std::string>();
+ const std::string& file_path = ExifUtil::ExifUtil::convertUriToPath(uri);
+ const std::string& real_path = common::FilesystemProvider::Create().GetRealPath(file_path);
+
+ CHECK_STORAGE_ACCESS(real_path, &out);
+
const double callback_id = args.get("callbackId").get<double>();
auto get = [=](const std::shared_ptr<JsonValue>& response) -> void {
ScopeLogger("Entered into asynchronous function, get");
PlatformResult status(ErrorCode::NO_ERROR);
- const std::string& file_path = ExifUtil::convertUriToPath(uri);
JsonValue result = JsonValue(JsonObject());
JsonObject& result_obj = result.get<JsonObject>();