-
Content Count
1196 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Bits, not bytes. I don't know the rest of the code, but I would suggest to initialize variable I to zero before the move so that the 4th byte is not at an unknown value. Also note that this code is not portable across processor architecture. Intel and AMD processors are "little endian" while ARM processor is "little endian" by default but may be changed. No idea if Android and iOS change the default value. To have predictable value and portable value, it is better to assemble the bytes your self. The code you have may be replaced by: I := Byte(S[1]) + ( Byte(S[2]) shl 8 )+ ( Byte(S[3]) shl 16 ); or event this, if the variable S is really a constant: I := Byte('r') + ( Byte('C') shl 8 )+ ( Byte('f') shl 16 ); This latest expression is constant and once compiled result in only a single CPU instruction.
-
This is way to broad! Use different conversation for each topic. And use a specific subject. Think that those conversation will remains for other to find help. Mixing everything will not help much other peoples, forcing them to read a lot of messages in a given conversation. The best is a lot of SMALL conversations focused on a specific topic. There is no problem if you start 10 conversations for 10 different topics. For the unicode string issue, I would select https://en.delphipraxis.net/forum/5-rtl-and-delphi-object-pascal/
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
That has no sense: you ask to change the way to convert from RGBA to RGB, so you can change that part. Sorry but I won't participate any more in this useless conversation about an XY problem. -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
As you like. There are other existing solutions to convert RGBA to RGB depending on which file format you want to create. An RGB stream copied to a file can't do much. The reader cannot even know the width and height. -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Yes, it is saved to file... Saved to which file format? Why are you not telling us the full story? It look to me that it is a XY problem. -
Delphi Community Edition (CE) is currently version 10.3.1. You can compile old Delphi code but you MAY encounter issues because strings (Since Delphi 2009, 10 years ago) are unicode strings (16 bits characters) instead of ansi (8 bits characters). Char, PChar and Strings are related to 16 bits characters. There is no problem with this change as long as strings where used just as string. But if you code use strings as general buffer to contain bytes, then you have to change that. Delphi CE still support 8 bits characters. The types are AnsiChar, AnsiString, AnsiPChar. Have a look at this : https://www.danysoft.com/estaticos/free/delphi-unicode-migration.pdf If you have questions, please open a new conversation with a suitable title because this topic has nothing to do with CE nor installing CE.
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Customer had bigger than 5000x3000 This is not what i call a large bitmap. 15 mega pixel is a normal size for picture. Most today's camera produce much larger images. My Sony A7III which is a mid-range camera produce 6000x4000 pixel while a Sony A7RIV produce 9504x6336 pixel image. I developed radiography software where images can be even really much larger . -
Does the executable stopped working on your own computer or on many Win10 computers? You said a form doesn't show, it is the only flaw? Are the form's position and size saved somewhere for the next run? If yes, maybe you added or removed a screen or changed layout of multiple screens and now the saved position and size are out of view? Does recompiling the application change anything?
-
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Please define what is a large bitmap for you. -
How to check internet connection with TWSocket ?
FPiette replied to steve faleiro's topic in ICS - Internet Component Suite
But not all servers reply to ping request... -
32bit RGBA TBitmap to RGB byte stream.
FPiette replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Maybe using pointers to avoid index computation? -
How to check internet connection with TWSocket ?
FPiette replied to steve faleiro's topic in ICS - Internet Component Suite
TWSocket is asynchronous (Means not blocking). Connect is just a request for TWSocket to do the connection. Connect returns long time before the actual connection is established. You really should read the documentation: http://wiki.overbyte.eu/wiki/index.php/Asynchronous_Paradigm You'd better start from an ICS example delivered in the distribution. -
Security - How freaky can you get!
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
To avoid reusable hash, one could to use the "challenge" protocol: 1) The client send a request to the server to get a "challenge" (For example a random string). 2) The client send a 2nd request having the password combined with challenge hashed together 3) The server check the hash he received from the client by comparing it with the hash he has computed using the know password, the known challenge and known way to combine them. 4) The server when creating a challenge give it a very short live time and cancel it when the hash is received. With that two steps procedure, the hacker capturing traffic can grab the challenge and the hash. The hash is usable only once and won't help for future connections. The hacker has to do reverse engineering either the client or the server to discover how the challenge and password are combined before computing the hash, an discover which kind of hash has been used. This reverse engineering requires to have access to the computer to get a copy of the software. Should be must more complex than "simply" capturing traffic with a sniffer. -
How to tell what code is locking a file resource within an application
FPiette replied to RaelB's topic in RTL and Delphi Object Pascal
Add the following API: LockFile, LockFileEx. -
How to tell what code is locking a file resource within an application
FPiette replied to RaelB's topic in RTL and Delphi Object Pascal
Using SysInternals ProcessExplorer, you'll see all applications and services running. When selecting one, you can display the handles that are active, among which the files. Using SysInternals ProcessMonitor, you can see in real time all the operation one or more application are doing with file/registry/process/network. You can set a filter to the file you are interested in to limit the size of display. Both tools are free. SysInternals is actually Microsoft... -
Security - How freaky can you get!
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
I will use HTTPs with certificate, but tools like fiddler can bypass HTTPS, When Fiddler intercept and decrypt HTTPS, It re-singing traffic with a self-signed certificate and that can be detected at each end of the connection. -
Security - How freaky can you get!
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
Use HTTPS with certificates. -
I'm not sure for trial version but as I said there is only one media for all version. What you get installed depends only on the keys you have. So I suggest: 1) If you still have trial installed, got to license manager (in bin directory), remove the trial license and the CE license you've got. 2) If it doesn't work, completely remove the trial version from your computer. That is run uninstall and the remove any folder/file/hidden file with Embarcadero in it's name and remove any registry key having Embarcadero in it's name. Reboot your computer. Then download from the link you received for CE (Hoping it works since you removed from your system everything on your system) 3) If download still doesn't work, try installing with the ISO trial you've got but don't use the trial keys but the CE keys. Note that I never installed CE so I'm not sure at all.
-
Maybe the server is temporary out. Try later... As far as I know, it is the keys which determines which Delphi flavor is installed. The media is always the same.
-
Sure it is. It is likely that the DLL the OP want to use do not come with library routine such as fopen() are not made available. As I said, if the Delphi code has just to transport the FILE * member (that is the DLL open, read, write and close the FILE *), there will be no problem. If the Delphi code has to open the file and provide a FILE * that will be problematic.
-
Compute nearest color
FPiette replied to FPiette's topic in Algorithms, Data Structures and Class Design
This will be part of an OpenSource application handling OpenStreetMap maps (And other similar map sources). The color distance is needed to import/export GPX files which contain tracks recorded by GPS device. Thanks a lot for sharing. -
If this member is just transported between the DLL and your application back and forth, then in Delphi you can declare it as pointer. But if the Delphi application has to open the file or otherwise access it, it will be very difficult to port to Delphi. Exact implementation of FILE * is compiler dependent. So you must know which compiler has been used.
-
It isn't. FILE * is a high level item to access a file. A THandle is a low level item. Around FILE * there are a number of C standard I/O routines.
-
Compute nearest color
FPiette replied to FPiette's topic in Algorithms, Data Structures and Class Design
Found this: https://en.wikipedia.org/wiki/Color_difference And there is a CIEDE2000 distance computation C++ implementation on GitHub: https://github.com/gfiumara/CIEDE2000 I will port this code to Delphi. Thanks everybody. -
Compute nearest color
FPiette replied to FPiette's topic in Algorithms, Data Structures and Class Design
And this site experience a 404 error. Will retry later. Thanks.