epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2006 The Android Open Source Project |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 9 | |
| 10 | #include "SkImageDecoder.h" |
| 11 | #include "SkColor.h" |
| 12 | #include "SkColorPriv.h" |
| 13 | #include "SkStream.h" |
| 14 | #include "SkTemplates.h" |
| 15 | #include "SkPackBits.h" |
| 16 | |
| 17 | #include "gif_lib.h" |
| 18 | |
| 19 | class SkGIFImageDecoder : public SkImageDecoder { |
| 20 | public: |
| 21 | virtual Format getFormat() const { |
| 22 | return kGIF_Format; |
| 23 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 24 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 25 | protected: |
reed@android.com | 3f1f06a | 2010-03-03 21:04:12 +0000 | [diff] [blame] | 26 | virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | static const uint8_t gStartingIterlaceYValue[] = { |
| 30 | 0, 4, 2, 1 |
| 31 | }; |
| 32 | static const uint8_t gDeltaIterlaceYValue[] = { |
| 33 | 8, 8, 4, 2 |
| 34 | }; |
| 35 | |
| 36 | /* Implement the GIF interlace algorithm in an iterator. |
| 37 | 1) grab every 8th line beginning at 0 |
| 38 | 2) grab every 8th line beginning at 4 |
| 39 | 3) grab every 4th line beginning at 2 |
| 40 | 4) grab every 2nd line beginning at 1 |
| 41 | */ |
| 42 | class GifInterlaceIter { |
| 43 | public: |
| 44 | GifInterlaceIter(int height) : fHeight(height) { |
| 45 | fStartYPtr = gStartingIterlaceYValue; |
| 46 | fDeltaYPtr = gDeltaIterlaceYValue; |
| 47 | |
| 48 | fCurrY = *fStartYPtr++; |
| 49 | fDeltaY = *fDeltaYPtr++; |
| 50 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 51 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 52 | int currY() const { |
| 53 | SkASSERT(fStartYPtr); |
| 54 | SkASSERT(fDeltaYPtr); |
| 55 | return fCurrY; |
| 56 | } |
| 57 | |
| 58 | void next() { |
| 59 | SkASSERT(fStartYPtr); |
| 60 | SkASSERT(fDeltaYPtr); |
| 61 | |
| 62 | int y = fCurrY + fDeltaY; |
| 63 | // We went from an if statement to a while loop so that we iterate |
| 64 | // through fStartYPtr until a valid row is found. This is so that images |
| 65 | // that are smaller than 5x5 will not trash memory. |
| 66 | while (y >= fHeight) { |
| 67 | if (gStartingIterlaceYValue + |
| 68 | SK_ARRAY_COUNT(gStartingIterlaceYValue) == fStartYPtr) { |
| 69 | // we done |
| 70 | SkDEBUGCODE(fStartYPtr = NULL;) |
| 71 | SkDEBUGCODE(fDeltaYPtr = NULL;) |
| 72 | y = 0; |
| 73 | } else { |
| 74 | y = *fStartYPtr++; |
| 75 | fDeltaY = *fDeltaYPtr++; |
| 76 | } |
| 77 | } |
| 78 | fCurrY = y; |
| 79 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 80 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 81 | private: |
| 82 | const int fHeight; |
| 83 | int fCurrY; |
| 84 | int fDeltaY; |
| 85 | const uint8_t* fStartYPtr; |
| 86 | const uint8_t* fDeltaYPtr; |
| 87 | }; |
| 88 | |
| 89 | /////////////////////////////////////////////////////////////////////////////// |
| 90 | |
| 91 | //#define GIF_STAMP "GIF" /* First chars in file - GIF stamp. */ |
| 92 | //#define GIF_STAMP_LEN (sizeof(GIF_STAMP) - 1) |
| 93 | |
| 94 | static int DecodeCallBackProc(GifFileType* fileType, GifByteType* out, |
| 95 | int size) { |
| 96 | SkStream* stream = (SkStream*) fileType->UserData; |
| 97 | return (int) stream->read(out, size); |
| 98 | } |
| 99 | |
| 100 | void CheckFreeExtension(SavedImage* Image) { |
| 101 | if (Image->ExtensionBlocks) { |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 102 | #if GIFLIB_MAJOR < 5 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 103 | FreeExtension(Image); |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 104 | #else |
| 105 | GifFreeExtensions(&Image->ExtensionBlockCount, &Image->ExtensionBlocks); |
| 106 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 107 | } |
| 108 | } |
| 109 | |
| 110 | // return NULL on failure |
| 111 | static const ColorMapObject* find_colormap(const GifFileType* gif) { |
| 112 | const ColorMapObject* cmap = gif->Image.ColorMap; |
| 113 | if (NULL == cmap) { |
| 114 | cmap = gif->SColorMap; |
| 115 | } |
djsollen@google.com | 57f4969 | 2011-02-23 20:46:31 +0000 | [diff] [blame] | 116 | |
| 117 | if (NULL == cmap) { |
| 118 | // no colormap found |
| 119 | return NULL; |
| 120 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 121 | // some sanity checks |
reed@android.com | bc7d2fb | 2010-02-05 15:43:07 +0000 | [diff] [blame] | 122 | if (cmap && ((unsigned)cmap->ColorCount > 256 || |
| 123 | cmap->ColorCount != (1 << cmap->BitsPerPixel))) { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 124 | cmap = NULL; |
| 125 | } |
| 126 | return cmap; |
| 127 | } |
| 128 | |
| 129 | // return -1 if not found (i.e. we're completely opaque) |
| 130 | static int find_transpIndex(const SavedImage& image, int colorCount) { |
| 131 | int transpIndex = -1; |
| 132 | for (int i = 0; i < image.ExtensionBlockCount; ++i) { |
| 133 | const ExtensionBlock* eb = image.ExtensionBlocks + i; |
| 134 | if (eb->Function == 0xF9 && eb->ByteCount == 4) { |
| 135 | if (eb->Bytes[0] & 1) { |
| 136 | transpIndex = (unsigned char)eb->Bytes[3]; |
| 137 | // check for valid transpIndex |
| 138 | if (transpIndex >= colorCount) { |
| 139 | transpIndex = -1; |
| 140 | } |
| 141 | break; |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | return transpIndex; |
| 146 | } |
| 147 | |
| 148 | static bool error_return(GifFileType* gif, const SkBitmap& bm, |
| 149 | const char msg[]) { |
| 150 | #if 0 |
| 151 | SkDebugf("libgif error <%s> bitmap [%d %d] pixels %p colortable %p\n", |
| 152 | msg, bm.width(), bm.height(), bm.getPixels(), bm.getColorTable()); |
| 153 | #endif |
| 154 | return false; |
| 155 | } |
| 156 | |
reed@android.com | 3f1f06a | 2010-03-03 21:04:12 +0000 | [diff] [blame] | 157 | bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) { |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 158 | #if GIFLIB_MAJOR < 5 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 159 | GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc); |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 160 | #else |
| 161 | GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc, NULL); |
| 162 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 163 | if (NULL == gif) { |
| 164 | return error_return(gif, *bm, "DGifOpen"); |
| 165 | } |
| 166 | |
| 167 | SkAutoTCallIProc<GifFileType, DGifCloseFile> acp(gif); |
| 168 | |
| 169 | SavedImage temp_save; |
| 170 | temp_save.ExtensionBlocks=NULL; |
| 171 | temp_save.ExtensionBlockCount=0; |
| 172 | SkAutoTCallVProc<SavedImage, CheckFreeExtension> acp2(&temp_save); |
| 173 | |
| 174 | int width, height; |
| 175 | GifRecordType recType; |
| 176 | GifByteType *extData; |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 177 | #if GIFLIB_MAJOR >= 5 |
| 178 | int extFunction; |
| 179 | #endif |
reed@android.com | 9781ca5 | 2009-04-14 14:28:22 +0000 | [diff] [blame] | 180 | int transpIndex = -1; // -1 means we don't have it (yet) |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 181 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 182 | do { |
| 183 | if (DGifGetRecordType(gif, &recType) == GIF_ERROR) { |
| 184 | return error_return(gif, *bm, "DGifGetRecordType"); |
| 185 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 186 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 187 | switch (recType) { |
| 188 | case IMAGE_DESC_RECORD_TYPE: { |
| 189 | if (DGifGetImageDesc(gif) == GIF_ERROR) { |
| 190 | return error_return(gif, *bm, "IMAGE_DESC_RECORD_TYPE"); |
| 191 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 192 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 193 | if (gif->ImageCount < 1) { // sanity check |
| 194 | return error_return(gif, *bm, "ImageCount < 1"); |
| 195 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 196 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 197 | width = gif->SWidth; |
| 198 | height = gif->SHeight; |
| 199 | if (width <= 0 || height <= 0 || |
| 200 | !this->chooseFromOneChoice(SkBitmap::kIndex8_Config, |
| 201 | width, height)) { |
| 202 | return error_return(gif, *bm, "chooseFromOneChoice"); |
| 203 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 204 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 205 | bm->setConfig(SkBitmap::kIndex8_Config, width, height); |
| 206 | if (SkImageDecoder::kDecodeBounds_Mode == mode) |
| 207 | return true; |
| 208 | |
| 209 | SavedImage* image = &gif->SavedImages[gif->ImageCount-1]; |
| 210 | const GifImageDesc& desc = image->ImageDesc; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 211 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 212 | // check for valid descriptor |
| 213 | if ( (desc.Top | desc.Left) < 0 || |
| 214 | desc.Left + desc.Width > width || |
| 215 | desc.Top + desc.Height > height) { |
| 216 | return error_return(gif, *bm, "TopLeft"); |
| 217 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 218 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 219 | // now we decode the colortable |
| 220 | int colorCount = 0; |
| 221 | { |
| 222 | const ColorMapObject* cmap = find_colormap(gif); |
| 223 | if (NULL == cmap) { |
| 224 | return error_return(gif, *bm, "null cmap"); |
| 225 | } |
| 226 | |
| 227 | colorCount = cmap->ColorCount; |
| 228 | SkColorTable* ctable = SkNEW_ARGS(SkColorTable, (colorCount)); |
| 229 | SkPMColor* colorPtr = ctable->lockColors(); |
| 230 | for (int index = 0; index < colorCount; index++) |
| 231 | colorPtr[index] = SkPackARGB32(0xFF, |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 232 | cmap->Colors[index].Red, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 233 | cmap->Colors[index].Green, |
| 234 | cmap->Colors[index].Blue); |
| 235 | |
reed@android.com | 9781ca5 | 2009-04-14 14:28:22 +0000 | [diff] [blame] | 236 | transpIndex = find_transpIndex(temp_save, colorCount); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 237 | if (transpIndex < 0) |
| 238 | ctable->setFlags(ctable->getFlags() | SkColorTable::kColorsAreOpaque_Flag); |
| 239 | else |
| 240 | colorPtr[transpIndex] = 0; // ram in a transparent SkPMColor |
| 241 | ctable->unlockColors(true); |
| 242 | |
| 243 | SkAutoUnref aurts(ctable); |
| 244 | if (!this->allocPixelRef(bm, ctable)) { |
| 245 | return error_return(gif, *bm, "allocPixelRef"); |
| 246 | } |
| 247 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 248 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 249 | SkAutoLockPixels alp(*bm); |
| 250 | |
| 251 | // time to decode the scanlines |
| 252 | // |
| 253 | uint8_t* scanline = bm->getAddr8(0, 0); |
| 254 | const int rowBytes = bm->rowBytes(); |
| 255 | const int innerWidth = desc.Width; |
| 256 | const int innerHeight = desc.Height; |
| 257 | |
| 258 | // abort if either inner dimension is <= 0 |
| 259 | if (innerWidth <= 0 || innerHeight <= 0) { |
| 260 | return error_return(gif, *bm, "non-pos inner width/height"); |
| 261 | } |
| 262 | |
| 263 | // are we only a subset of the total bounds? |
| 264 | if ((desc.Top | desc.Left) > 0 || |
| 265 | innerWidth < width || innerHeight < height) |
| 266 | { |
reed@android.com | 9781ca5 | 2009-04-14 14:28:22 +0000 | [diff] [blame] | 267 | int fill; |
| 268 | if (transpIndex >= 0) { |
| 269 | fill = transpIndex; |
| 270 | } else { |
| 271 | fill = gif->SBackGroundColor; |
| 272 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 273 | // check for valid fill index/color |
reed@android.com | 9781ca5 | 2009-04-14 14:28:22 +0000 | [diff] [blame] | 274 | if (static_cast<unsigned>(fill) >= |
| 275 | static_cast<unsigned>(colorCount)) { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 276 | fill = 0; |
| 277 | } |
reed@android.com | 9781ca5 | 2009-04-14 14:28:22 +0000 | [diff] [blame] | 278 | memset(scanline, fill, bm->getSize()); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 279 | // bump our starting address |
| 280 | scanline += desc.Top * rowBytes + desc.Left; |
| 281 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 282 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 283 | // now decode each scanline |
| 284 | if (gif->Image.Interlace) |
| 285 | { |
| 286 | GifInterlaceIter iter(innerHeight); |
| 287 | for (int y = 0; y < innerHeight; y++) |
| 288 | { |
| 289 | uint8_t* row = scanline + iter.currY() * rowBytes; |
| 290 | if (DGifGetLine(gif, row, innerWidth) == GIF_ERROR) { |
| 291 | return error_return(gif, *bm, "interlace DGifGetLine"); |
| 292 | } |
| 293 | iter.next(); |
| 294 | } |
| 295 | } |
| 296 | else |
| 297 | { |
| 298 | // easy, non-interlace case |
| 299 | for (int y = 0; y < innerHeight; y++) { |
| 300 | if (DGifGetLine(gif, scanline, innerWidth) == GIF_ERROR) { |
| 301 | return error_return(gif, *bm, "DGifGetLine"); |
| 302 | } |
| 303 | scanline += rowBytes; |
| 304 | } |
| 305 | } |
| 306 | goto DONE; |
| 307 | } break; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 308 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 309 | case EXTENSION_RECORD_TYPE: |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 310 | #if GIFLIB_MAJOR < 5 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 311 | if (DGifGetExtension(gif, &temp_save.Function, |
| 312 | &extData) == GIF_ERROR) { |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 313 | #else |
| 314 | if (DGifGetExtension(gif, &extFunction, &extData) == GIF_ERROR) { |
| 315 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 316 | return error_return(gif, *bm, "DGifGetExtension"); |
| 317 | } |
| 318 | |
| 319 | while (extData != NULL) { |
| 320 | /* Create an extension block with our data */ |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 321 | #if GIFLIB_MAJOR < 5 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 322 | if (AddExtensionBlock(&temp_save, extData[0], |
| 323 | &extData[1]) == GIF_ERROR) { |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 324 | #else |
| 325 | if (GifAddExtensionBlock(&gif->ExtensionBlockCount, |
| 326 | &gif->ExtensionBlocks, |
| 327 | extFunction, |
| 328 | extData[0], |
| 329 | &extData[1]) == GIF_ERROR) { |
| 330 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 331 | return error_return(gif, *bm, "AddExtensionBlock"); |
| 332 | } |
| 333 | if (DGifGetExtensionNext(gif, &extData) == GIF_ERROR) { |
| 334 | return error_return(gif, *bm, "DGifGetExtensionNext"); |
| 335 | } |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 336 | #if GIFLIB_MAJOR < 5 |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 337 | temp_save.Function = 0; |
reed@google.com | bb89613 | 2013-02-01 19:05:48 +0000 | [diff] [blame] | 338 | #endif |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 339 | } |
| 340 | break; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 341 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 342 | case TERMINATE_RECORD_TYPE: |
| 343 | break; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 344 | |
| 345 | default: /* Should be trapped by DGifGetRecordType */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 346 | break; |
| 347 | } |
| 348 | } while (recType != TERMINATE_RECORD_TYPE); |
| 349 | |
| 350 | DONE: |
| 351 | return true; |
| 352 | } |
| 353 | |
| 354 | /////////////////////////////////////////////////////////////////////////////// |
robertphillips@google.com | ec51cb8 | 2012-03-23 18:13:47 +0000 | [diff] [blame] | 355 | DEFINE_DECODER_CREATOR(GIFImageDecoder); |
| 356 | /////////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 357 | |
reed@android.com | 00bf85a | 2009-01-22 13:04:56 +0000 | [diff] [blame] | 358 | #include "SkTRegistry.h" |
| 359 | |
robertphillips@google.com | 8570b5c | 2012-03-20 17:40:58 +0000 | [diff] [blame] | 360 | static SkImageDecoder* sk_libgif_dfactory(SkStream* stream) { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 361 | char buf[GIF_STAMP_LEN]; |
| 362 | if (stream->read(buf, GIF_STAMP_LEN) == GIF_STAMP_LEN) { |
| 363 | if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || |
| 364 | memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 || |
| 365 | memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) { |
| 366 | return SkNEW(SkGIFImageDecoder); |
| 367 | } |
| 368 | } |
| 369 | return NULL; |
| 370 | } |
| 371 | |
robertphillips@google.com | 8570b5c | 2012-03-20 17:40:58 +0000 | [diff] [blame] | 372 | static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_libgif_dfactory); |