Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix build single resource params #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
adimiz1 merged 1 commit into master from fix/restore_by_asset_id
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cloudinary-core/src/main/java/com/cloudinary/Api.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public ApiResponse resourceByAssetID(String assetId, Map options) throws Excepti
if(options.get("fields") != null) {
options.put("fields", StringUtils.join(ObjectUtils.asArray(options.get("fields")), ","));
}
Map params = ObjectUtils.only(options, "tags", "context", "moderations", "fields");
Map params = buildResourceDetailParams(options);
ApiResponse response = callApi(HttpMethod.GET, Arrays.asList("resources", assetId), params, options);
return response;
}
Expand Down Expand Up @@ -209,15 +209,19 @@ public ApiResponse resource(String public_id, Map options) throws Exception {
if (options == null) options = ObjectUtils.emptyMap();
String resourceType = ObjectUtils.asString(options.get("resource_type"), "image");
String type = ObjectUtils.asString(options.get("type"), "upload");
Map params = buildResourceDetailParams(options);

ApiResponse response = callApi(HttpMethod.GET, Arrays.asList("resources", resourceType, type, public_id),
ObjectUtils.only(options, "exif", "colors", "faces", "coordinates",
"image_metadata", "pages", "phash", "max_results", "quality_analysis", "cinemagraph_analysis",
"accessibility_analysis", "versions", "media_metadata", "derived_next_cursor"), options);
ApiResponse response = callApi(HttpMethod.GET, Arrays.asList("resources", resourceType, type, public_id), params, options);

return response;
}

private Map buildResourceDetailParams(Map options) {
return ObjectUtils.only(options, "exif", "colors", "faces", "coordinates",
"image_metadata", "pages", "phash", "max_results", "quality_analysis", "cinemagraph_analysis",
"accessibility_analysis", "versions", "media_metadata", "derived_next_cursor");
}

public ApiResponse update(String public_id, Map options) throws Exception {
if (options == null) options = ObjectUtils.emptyMap();
String resourceType = ObjectUtils.asString(options.get("resource_type"), "image");
Expand Down

AltStyle によって変換されたページ (->オリジナル) /