Go 1.11은 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Go 1.11 애플리케이션을 배포할 수 없습니다. 기존 Go 1.11 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 Go 버전으로 마이그레이션하는 것이 좋습니다.
Images API는 Google Cloud Storage 또는 Blobstore에서 직접 이미지를 제공하고 즉시 이 이미지를 조작할 수 있는 기능을 제공합니다. image 패키지의 콘텐츠를 보려면 image 패키지 참조를 확인하세요.
Images API가 작동하려면 Cloud Storage 버킷은 세분화된 API 액세스 제어 목록(ACL)을 사용해야 합니다. 균일한 버킷 수준 액세스용으로 구성된 버킷의 경우 Images API가 해당 버킷의 이미지를 가져올 수 없으며 TransformationError 오류 메시지가 표시됩니다. 버킷이 이러한 방식으로 구성된 경우 균일한 버킷 수준 액세스를 사용 중지할 수 있습니다.
이미지 형식
서비스에 JPEG, PNG, WEBP, GIF(애니메이션 GIF 포함), BMP, TIFF, ICO 형식의 이미지 데이터를 입력할 수 있습니다. 변환된 이미지는 JPEG, WEBP, PNG 형식으로 반환될 수 있습니다.
입력 형식과 출력 형식이 서로 다른 경우 서비스는 변환을 수행하기 전에 입력 데이터를 출력 형식으로 변환합니다.
이미지 제공 및 크기 조정
image.ServingURL 함수를 사용하면 웹에 적합한 이미지 미리보기 이미지를 제공할 수 있는 안정적인 전용 URL을 생성할 수 있습니다.
Blobstore에 원본 이미지의 단일 복사본을 저장한 다음 이미지의 크기를 조정하거나 자동으로 자를 수 있는 고성능 이미지 단위 URL을 요청할 수 있습니다. 이 URL에서 제공하면 CPU나 동적 제공 로드가 발생하지 않습니다(대역폭은 평소와 같이 청구됩니다).
이 함수가 반환하는 URL은 항상 공개되어 있지만 추측은 불가능하며, 비공개 URL은 현재 지원되지 않습니다. URL 제공을 중지하려면 image.DeleteServingURL 함수를 사용하여 삭제합니다.
image.ServingURLOptions 값을 함수에 전달하면 이 옵션으로 인코딩된 URL이 반환됩니다. nil을 전달하면 함수는 이미지의 기본 URL을 반환합니다. 예를 들면 다음과 같습니다.
http://lhx.ggpht.com/randomStringImageId
URL에 인수를 지정하여 동적으로 이미지 크기를 조정하고 자를 수 있습니다. 사용 가능한 인수는 다음과 같습니다.
=sxx: 여기서 xx는 이미지에서 가장 긴 변의 길이(픽셀 단위)를 나타내는 0~2560 사이의 정수입니다. 예를 들어 =s32를 추가하면 이미지의 가장 긴 변이 32픽셀이 되도록 크기가 조절됩니다.
=sxx-c: 여기서 xx는 잘린 이미지 크기(픽셀 단위)를 나타내는 0~2560 사이의 정수입니다. -c는 이미지를 자르도록 시스템에 지시합니다.
# Resize the image to 32 pixels (aspect-ratio preserved)
http://lhx.ggpht.com/randomStringImageId=s32
# Crop the image to 32 pixels
http://lhx.ggpht.com/randomStringImageId=s32-c
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThe Images API enables serving and manipulating images directly from Google Cloud Storage or Blobstore, with support for various formats like JPEG, PNG, and WEBP.\u003c/p\u003e\n"],["\u003cp\u003eCloud Storage buckets must use fine-grained Access Control Lists for the Images API to function correctly; uniform bucket-level access can cause errors and should be disabled.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eimage.ServingURL\u003c/code\u003e function generates stable, public URLs for serving resized or cropped image thumbnails, offloading CPU and dynamic serving load from your application.\u003c/p\u003e\n"],["\u003cp\u003eImages can be dynamically resized or cropped by adding arguments such as \u003ccode\u003e=sxx\u003c/code\u003e or \u003ccode\u003e=sxx-c\u003c/code\u003e to the serving URL, where \u003ccode\u003exx\u003c/code\u003e represents the desired pixel dimension.\u003c/p\u003e\n"],["\u003cp\u003eTo properly remove images, you should use the \u003ccode\u003eimage.DeleteServingURL\u003c/code\u003e function instead of directly deleting images from Cloud Storage or Blobstore, as direct deletion can leave images accessible through their serving URLs.\u003c/p\u003e\n"]]],[],null,["# Images API for legacy bundled services\n\nThe Images API provides the ability to serve images directly from [Google Cloud\nStorage](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/read-write-to-cloud-storage)\nor Blobstore, and to manipulate those images on the fly. To view\nthe contents of the `image` package, see the [`image` package\nreference](/appengine/docs/legacy/standard/go111/reference/latest/image).\n\nCloud Storage buckets **must** use fine-grained [Access Control Lists](/storage/docs/access-control/create-manage-lists) for the Images API to work. For buckets that have been configured for uniform bucket-level access, the Images API will not be able to fetch images in that bucket and throws the error message `TransformationError`. If your bucket is configured in this manner, you can [disable uniform bucket-level access](/storage/docs/uniform-bucket-level-access#set).\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nImage formats\n-------------\n\nThe service accepts image data in the JPEG, PNG, WEBP, GIF (including animated\nGIF), BMP, TIFF and ICO formats. Transformed images can be returned in the JPEG,\nWEBP and PNG formats.\n\nIf the input format and the output format are different, the service converts\nthe input data to the output format before performing the transformation.\n| **Note:** The Images service does not support multilayer TIFF images.\n\nServing and re-sizing images\n----------------------------\n\nThe [`image.ServingURL`](/appengine/docs/legacy/standard/go111/reference/latest/image#google_golang_org_appengine_image_ServingURL)\nfunction allows you to generate a stable, dedicated URL for serving web-suitable\nimage thumbnails.\n\nYou can store a single copy of your original image in\nBlobstore, and then request a high-performance per-image URL that can serve the\nimage resized and/or cropped automatically. Serving from this\nURL does not incur any CPU or dynamic serving load on your application (though\nbandwidth is still charged as usual).\n\nThe URL returned by the function is always public, but not guessable; private\nURLs are not currently supported. If you wish to stop serving the URL, delete it\nusing the\n[`image.DeleteServingURL`](/appengine/docs/legacy/standard/go/images/reference#DeleteServingURL)\nfunction.\n\nIf you pass an\n[`image.ServingURLOptions`](/appengine/docs/legacy/standard/go111/reference/latest/image#google_golang_org_appengine_image_ServingURLOptions)\nvalue to the function, it returns a URL encoded with those options. If you pass\n`nil`, the function returns the default URL for the image, for example:\n\n\u003cbr /\u003e\n\n```\nhttp://lhx.ggpht.com/randomStringImageId\n```\n\nYou can resize and crop the image dynamically by specifying the arguments in the\nURL. The available arguments are:\n\n- `=sxx` where `xx` is an integer from 0--2560 representing the length, in pixels, of the image's longest side. For example, adding `=s32` resizes the image so its longest dimension is 32 pixels.\n- `=sxx-c` where **xx** is an integer from 0--2560 representing the cropped image size in pixels, and `-c` tells the system to crop the image.\n\n**Important:** Only the resize and crop arguments listed above are supported. Using any other arguments might result in breaking failures. \n\n```\n# Resize the image to 32 pixels (aspect-ratio preserved)\nhttp://lhx.ggpht.com/randomStringImageId=s32\n\n# Crop the image to 32 pixels\nhttp://lhx.ggpht.com/randomStringImageId=s32-c\n```\n\nServing images from Cloud Storage using the Blobstore API\n---------------------------------------------------------\n\nIf you are using Cloud Storage as a data store and serving the images using the\nBlobstore API, you need to [create a blob key for the Cloud Storage object](/appengine/docs/legacy/standard/go111/blobstore).\n\nA note about deletion\n---------------------\n\nTo stop serving an image stored in Cloud Storage or Blobstore call\nthe\n[`image.DeleteServingURL`](/appengine/docs/legacy/standard/go111/reference/latest/image#google_golang_org_appengine_image_DeleteServingURL)\nfunction.\n\nYou should avoid directly deleting images in Cloud Storage or Blobstore as doing\nso can leave them accessible through the serving URL.\n\nServing URLs will stop working if the application that created them is disabled\nor deleted, even if the underlying image remains available."]]