i have tried to open some JPEG files in Delphi with TImage component. i also added the Jpeg unit. i can open most of jpg files and there is no problem.
but when i try to open some JPGs, the program just throw an exception.
i also tried to load that images in design mode, but there is some problem. in design mode the exception is:
Access violation at address 402672A1 in module 'vcljpeg70.bpl'. Write of address 08E84000
Why i cannot open that JPGs? they are not corrupted. i checked them in some tools like savantools EXIF viewer.
here is the URL of one of that images:
http://xs842.xs.to/xs842/09340/backpic435.jpg
Thanks so much
PS:
My Delphi version is 7. Borland Delphi 7
The reason you may be encountering this problem is due to the file type. Delphi has issues displaying JPEG images that have been encoded using CMYK, rather than the default RGB encoding. CMYK is a format that is generally used for Print design, try and always encode your images to RGB format to avoid this issue with Delphi.
Patch for Delphi jpeg.dcu
Bye.
Interesting. Neither Internet Explorer nor Google Chrome will display that JPEG image you linked to. I do not get 404 Not Found errors, I simply get an image placeholder, indicating that the image could not be opened/displayed correctly.
FireFox does display the image.
Are you certain that there is not something fishy, or at least slightly unusual, about the JPG files involved?
UPDATE: The file linked to in the question opens in PaintShop Pro (an old version 6.0 installation) - if I then simply re-save as a Standard Encoding JPEG, IE and Chrome both display the newly saved image as I'd expect. There would definitely appear to be something a bit "odd-ball" about the encoding of the original JPEG that some JPEG apps can handle but not all, including some "major players", not just Delphi. :)
Check out the Free Image library for alternative JPEG support in Delphi if the native one has problems. Free Image is an open source lib that lets you work with JPEG/PNG/... from Delphi/BCB/and others. Very nice library IMHO.
http://freeimage.sourceforge.net/
I've looked at the file with a hex editor, and found 3 JFIF headers. After extracting each part, I found 2 thumbnails and an image. Nothing special, because embedded thumbnails seem to be part of the EXIF2 standard.
The thumbnails themselves load fine in Delphi, and converting the file to something readable can be done with almost every piece of software that I've tried.
Anyway, this page will give you very detailed information about the picture, and what headers are inside (just paste the url of your image in the textbox):
http://www.monster-submit.com/resources/jpeganalyzer/
I get the same error. This appears to be a bug in Delphi's JPEG lib. You should report it to QC.
SimDesign's NativeJpg can open that file. It's a JPEG library written entirely in Delphi, and the author has been good about adding support for new extensions and color spaces when we've run into them. In addition to a TGraphic descendant for TImage support it exposes lots of lower-level interfaces for manipulating JPEGs, though I haven't used them.
Related
I have a ID3D11Texture2D and want to write it to disk using literally any picture format (png, bmp, jpeg, ...).
I have already tried to read the docs https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nn-d3d11-id3d11texture2d, which are less than helpful, and i have found an NVIDIA tutorial of how to take individual ID3D11Texture2D and convert them into a video: https://github.com/NVIDIA/video-sdk-samples/tree/master/nvEncDXGIOutputDuplicationSample
However, I dont find anything how to simply write it to disk in any format. I'm sure I'm missing something obvious, any hint would be appreciated.
To experiment, I used https://github.com/NVIDIA/video-sdk-samples/tree/master/nvEncDXGIOutputDuplicationSample, set the frames to capture to 1, and try to write the ID3D11Texture2D to file before encoding to video.
I have a solution for exactly this in the ScreenGrab module which captures a texture (if not already in Map-supporting memory), and then writes it out as a picture using WIC. It handles some edge-cases like "typeless" resources and MSAA as well.
The 'standalone' version is on GitHub here as part of the DirectXTex package:
https://github.com/microsoft/DirectXTex/blob/main/ScreenGrab/ScreenGrab11.h
https://github.com/microsoft/DirectXTex/blob/main/ScreenGrab/ScreenGrab11.cpp
Documentation is here.
ScreenGrab is also included in the DirectX Tool Kit for DX11 and DX12. There's also a basic DX9 version in the DirectXTex package as well.
ScreenGrab can write to any file container supported by WIC. It also has buit-in support for writing DDS files directly without using WIC.
In addition to using ScreenGrab (which is intended as a light-weight screenshot solution), you can also use the DirectTex library to capture a texture and then save it to DDS, HDR, TGA, or any WIC-supported file format.
I'm writing a mod for a game that uses lua/luajit as a scripting language and I would like to create a png file dynamically using lua. I've been googling for a png library/module but could only find ones that merely read pngs (like https://github.com/Didericis/png-lua or https://luapower.com/libpng), or create uncompressed pngs: https://github.com/wyozi/lua-pngencoder
On my search I have stumbled upon libpng and thought, maybe I could simply load that dll using ffi and use the functions that way. But the problem is that is waaaay too complicated for me, since I'm not familiar with C and furthermore libpng seems to be a huuuuuge complicated library.
So, is there any simple way (module/library) that I missed and didn't find on google?
I just need very simple functionality, create a png, set the pixels, save it as a compressed png file.
I have a Remote Administration Tool and was necessary change for 64 bits plattform. I have used Zlib for compress and decompress memorystreams, but after do this change, Zlib classes showed several errors when I tried compile my project in 64 bits plattform, because Zlib only is avaiable for 32 bits plattform.
Then,I had that search on internet for some similar classes for make compress and decompress of memorystreams and I found this question where discussion is about LZMA class that also can make like I need, similar to Zlib class.
And I understood the advice:
The big issue that you will face is that the library you have chosen to use requires you to know how large the file is that you are decompressing.
So, I'm here exactly for know some suggestion for try solve this trouble.
In others words, I want know how decompress exactly the size of memorystream that is received by Server side of my project?
Any opinion or suggestion here is welcome.
OK, it looks like you're using ZLibEX, by Roberto Della Pasqua, Borland:
https://github.com/senjaxus/Delphi_Remote_Access_PC/blob/master/Fontes%20Access%20PC%20-%20Delphi%207/Cliente/ZLIBEX.pas
You're correct - the assembly portion MoveI32 is non-portable.
BUT ...
You should be able to use the same API in your current Delphi XE-5 from System.Zlib:
http://docwiki.embarcadero.com/Libraries/XE5/en/System.ZLib
http://delphiblog.twodesk.com/native-zip-file-support-in-delphi-xe2
http://docwiki.embarcadero.com/CodeExamples/Seattle/en/ZLibCompressDecompress_%28Delphi%29
I'd like to use LibTiff with XE3 to access image meta data information from TIFF files.
I need to find the number of pages inside tiff and their sizes.
I suggested LibTiff because I need the fastest possible implementation of reading tiff image meta data.
The only link I have found is not working anymore:
http://www.awaresystems.be/imaging/tiff/delphi.html
OK, Internet Archive has returned back to operational state, and here is your download:
LibTiffDelphi, full version. Large download (approx 1.39 megabyte), includes Debug and Release versions
Well, the download links at that site do appear to be down. You could try downloading from here instead: http://www.vdebris.comli.com/wp-content/uploads/2009/09/libtiffdelphi_3_9_1.rar
I think you could use Mike Lischke's GraphicEx to solve your problem. The TImageProperties record that is made available by the TGraphicExGraphic class appears to have what you need.
found that code working with *.tif and used graphics + lib for solution building TIF SPLITTER
not sure if it helps to solve your problem
Has anyone had luck converting and using jpeg2000 on the ios? I am writing and inventory app and would love to go with a jpeg2000 file type if I can figure out how to get the phone to support it.
I have seen that there is a nice project for webp - https://github.com/carsonmcdonald/WebP-iOS-example - which seems like it would also work but I think the jpeg2000 results are even better.
Just trying to eval options. Thx in advance
We used JPEG 2000 for my last project (Spot.app)
I downloaded the official open-source JPEG 2000 codec source from here: http://www.openjpeg.org/index.php?menu=download
Build it into a static library and voila.
Here's some sample code I created: https://gist.github.com/1861465
Image IO has nice image conversion functions that eliminate the need for 3rd party code. See more here: How do I convert UIImage to J2K (JPEG2000) in iOS?
No need to bring in the JPEG 2000 project.