docs: @Override
      public Directory read(final ImageInputStream input) throws IOException {
          Validate.notNull(input, "input");
  
          List<PSDEntry> entries = new ArrayList<>();
  
          while (true) {
              try {
                  int type = input.readInt();
  
                  switch (type) {
                      case PSD.RESOURCE_TYPE_IMAGEREADY:
                      case PSD.RESOURCE_TYPE_PHOTODELUXE:
                      case PSD.RESOURCE_TYPE_LIGHTROOM:
                      case PSD.RESOURCE_TYPE_DCSR:
                          // TODO: Warning for these types!
                      case PSD.RESOURCE_TYPE:
                          break;
                      default:
                          throw new IIOException(String.format("Wrong image resource type, expected '8BIM': '%08x'", type));
                  }
  
                  short id = input.readShort();
  
                  PSDResource resource = new PSDResource(id, input);
                  entries.add(new PSDEntry(id, resource.name(), resource.data()));
  
              }
              catch (EOFException e) {
                  break;
              }
          }
  
          return new PSDDirectory(entries);
      }