GR32.ImageFormats.JPG.pas 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. unit GR32.ImageFormats.JPG;
  2. (* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1 or LGPL 2.1 with linking exception
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * Alternatively, the contents of this file may be used under the terms of the
  16. * Free Pascal modified version of the GNU Lesser General Public License
  17. * Version 2.1 (the "FPC modified LGPL License"), in which case the provisions
  18. * of this license are applicable instead of those above.
  19. * Please see the file LICENSE.txt for additional information concerning this
  20. * license.
  21. *
  22. * The Original Code is Jpeg Image Format support for Graphics32
  23. *
  24. * The Initial Developer of the Original Code is
  25. * Anders Melander <[email protected]>
  26. *
  27. * Portions created by the Initial Developer are Copyright (C) 2008-2022
  28. * the Initial Developer. All Rights Reserved.
  29. *
  30. * Contributor(s):
  31. *
  32. * ***** END LICENSE BLOCK ***** *)
  33. // WEAKPACKAGEUNIT so we can include the unit in the GR32 design time
  34. // package in order to have the design time editor support the various formats.
  35. {$WEAKPACKAGEUNIT ON}
  36. interface
  37. {$include GR32.inc}
  38. implementation
  39. uses
  40. {$ifdef FPC}
  41. Graphics,
  42. {$else FPC}
  43. Jpeg,
  44. JConsts,
  45. {$endif FPC}
  46. GR32.ImageFormats,
  47. GR32.ImageFormats.TGraphic;
  48. {$ifdef FPC}
  49. resourcestring
  50. sJPEGImageFile = 'JPEG Image File';
  51. {$endif FPC}
  52. //------------------------------------------------------------------------------
  53. //------------------------------------------------------------------------------
  54. //------------------------------------------------------------------------------
  55. initialization
  56. ImageFormatManager.RegisterImageFormat(
  57. TImageFormatReaderWriterTGraphic.Create(TJPEGImage, sJPEGImageFile, ['jpg', 'jpeg']),
  58. ImageFormatPriorityNormal);
  59. end.