<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/CGImageSourceGetCount(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@F@CGImageSourceGetCount"
  },
  "title" : "CGImageSourceGetCount(_:)"
}
-->

# CGImageSourceGetCount(_:)

Returns the number of images (not including thumbnails) in the image source.

```
func CGImageSourceGetCount(_ isrc: CGImageSource) -> Int
```

## Parameters

`isrc`

The image source that contains the image data.

## Return Value

The number of images. If the image source is a multilayered Photoshop (PSD) file, the function returns `1`.

## Discussion

This function does not extract the layers of a PSD file.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)