Go 1.11 はサポートが終了しており、2026 年 1 月 31 日に非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Go 1.11 アプリケーションをデプロイできなくなります。既存の Go 1.11 アプリケーションは、非推奨日以降も引き続き実行され、トラフィックを受信します。サポートされている最新バージョンの Go に移行することをおすすめします。
Cloud Storage バケットで、Images API が機能するためには、きめ細かいアクセス制御リストを使用する必要があります。均一なバケットレベルのアクセスが構成されているバケットの場合、Images API はバケット内の画像を取得できず、エラー メッセージ TransformationError をスローします。バケットがこのように構成されている場合は、均一なバケットレベルのアクセスを無効にすることができます。
=sxx: ここで xx は、画像の長辺の長さをピクセル単位で表す 0~2,560 の整数です。たとえば、=s32 を追加すると、画像の長辺の寸法が 32 ピクセルになるように画像のサイズが変更されます。
=sxx-c: ここで xx は、切り抜かれた画像サイズをピクセル単位で表す 0~2,560 の整数です。-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."]]