Compare commits

...

167 Commits

Author SHA1 Message Date
David Korth
19e50372da [librptexture] ICO: For Win1.x icons with both DIB and DDB, show both in the icon directory.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
The DDB is usually half the size of the DIB.

NOTE: The DDB, which comes after the DIB, is missing the format WORD.
The header is otherwise the same format.

Rename vv_icons to v_icons, since it's not a vector of vectors.
2025-06-17 20:09:41 -04:00
David Korth
37dcb72e6b CMakeLists.txt: Use .99 versions for CMake VERSION_GREATER checks. 2025-06-16 21:44:24 -04:00
David Korth
2613201bb3 NEWS.md: Mention the 'abgr' swizzle issue on little-endian systems. 2025-06-16 19:46:40 -04:00
David Korth
aeb568dda3 [librptexture] rp_image::swizzle(): Fix the 'rgba' check.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
Need to byteswap it on little-endian. Otherwise, it'll end up catching
'abgr' instead.

Also, add a big-endian check on Neon, since it's possible for ARM to
operate in big-endian mode.
2025-06-16 19:33:16 -04:00
David Korth
a138b123e3 [librptexture] qoi.h: Swap R/B in qoi_encode() and qoi_decode().
This eliminates the need to call rp_image::swizzle() in
QoiPrivate::loadImage().

qoi.h now expects images to be in the same ARGB32 format
as the rest of rom-properties.

NOTE: Only adjusting what's read from or written to bytes[],
not the internal pixel buffers.
2025-06-16 19:32:30 -04:00
David Korth
4badcf4bfb [libromdata/tests] ImageDecoderTest: Add two Qoi test images.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
- argb-reference.qoi: Qoi version of argb-reference.png
- rgb-reference.qoi: Qoi version of rgb-reference.png
2025-06-16 01:06:17 -04:00
David Korth
b0d5e05cce [librptexture] qoi.h: Revert the qoi_decode() change.
A new test I added failed with the qoi_decode() change. Reverting it
fixes the test, even with the qoi_read_32() optimization still in place.
2025-06-16 01:05:40 -04:00
David Korth
523de9913c [librptexture] qoi.h: Optimize 32-bit reads and writes.
...for the basic read/write functions and qoi_decode().

qoi_encode() isn't being used at the moment, so I'm not going to try
to optimize it.

TODO: Verify that the memcpy()'s don't break on big-endian.
2025-06-16 00:57:49 -04:00
David Korth
f0ee7bee10 [librptexture] Qoi: qoi.h has the R and B channels swapped compared to what rp_image expects.
This was broken since support for Qoi was added in v2.5. Not sure why
I didn't notice it until now...

Affects: v2.4 - v2.5
2025-06-16 00:51:54 -04:00
David Korth
c3643b9244 [libpng] Update: v1.6.48 -> v1.6.49
Includes the APNG patch.
2025-06-15 14:25:09 -04:00
David Korth
72b628d8ba [win32] RP_ShellPropSheetExt_Private::initListData(): Use nearest-neighbor for integer upscaling. 2025-06-15 11:35:55 -04:00
David Korth
933b3d2f4e NEWS.md: Mention KF5/KF6 RFT_LISTDATA image quality improvements. 2025-06-15 11:25:53 -04:00
David Korth
eee8b83f9a [kde] ListDataModel::updateIconPixmaps(): Improve icon scaling on Qt5 and Qt6.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
Instead of scaling larger icons down, set a device pixel ratio. For the
usual case of iconSize = (32, 32), on a 200% display, the actual physical
icon size is (64, 64). Xbox 360 achievement icons are 64x64, so this will
show the full icon on a 200% display instead of scaling down to 32x32,
then scaling back up to 64x64.

For icons smaller than 32x32, the icon is scaled up using integer factors
to the next highest integer multiple that's >= 32x32, then the device
pixel ratio is set.

NOTE: GTK+ doesn't seem to have the same issue.

TODO: Verify Win32, especially with icon directories.
2025-06-15 11:17:42 -04:00
David Korth
b19f128903 [librptexture] ICOPrivate::~ICOPrivate(): Use dir.is_res instead of isResource().
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
Removed isResource().
2025-06-13 18:35:18 -04:00
David Korth
73eb28c4ee [librptexture] ICO: Show the icon directory with all the icon variants.
For standalone Win3.x icons and cursors only.

Color depth and format are shown, including if it's PNG format.

ICOPrivate::loadImage(): Remove caching stuff, since it's handled
by ICO::loadInternalImage().
2025-06-13 18:30:09 -04:00
David Korth
e5c512ca92 [rp-download] SetFileOriginInfo_win32.cpp: Load NTDLL.DLL function pointers using GetProcAddress().
AppVeyor's MSVC 2015 image doesn't have ntdll.lib for some reason.
2025-06-13 18:14:49 -04:00
David Korth
1da1c39c18 [librptexture] ICO: Remove pIconHeader.
Use dir.bestIcon_idx as an index into d->iconBitmapHeaders[] instead.
2025-06-13 18:13:16 -04:00
David Korth
da852e5d50 [librptexture] ICOPrivate::loadIconDirectory_Win3(): Missed an le32_to_cpu(). 2025-06-13 18:08:02 -04:00
David Korth
f157be4a97 [rp-download] SetFileOriginInfo_win32.cpp: Use NTDLL to write the Alternate Data Stream with just the file handle.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
Note that we have to use NtWriteFile(). Using WriteFile() results in
ERROR_BAD_COMMAND.

If the ADS write fails, it will be deleted with NtDeleteFile().

NOTE: Unicode only! ANSI builds won't write the ADS anymore.
ANSI builds (if they even work at all) should only be used on
Win9x, which doesn't support ADS anyway.

TODO: Convert NTSTATUS to POSIX error codes?
2025-06-12 23:33:56 -04:00
David Korth
a19815f744 [librptexture] ICO: Remove imageResType() in favor of dir.rt and dir.is_res.
This simplifies the code a bit more and removes some function calls.

dir.rt is the individual bitmap resource type: RT_ICON, RT_CURSOR
dir.is_res is true for .exe/.dll resources, and false for .ico/.cur files.
2025-06-12 22:00:05 -04:00
David Korth
a5554fd244 [librptexture] ICO: Remove pBestIcon from the icodir structs. Use an index instead.
This simplifies things a bit.
2025-06-12 21:42:18 -04:00
David Korth
0c512deed6 [librptexture] ICO: Rework the private loadImage_*() functions (except Win1) to take a bitmap image index.
This will allow us to show a list of all the bitmaps in a given icon.

NOTE: loadInternalImage() ensures that d->img_icon is set to the "best"
icon; that is, icon index "-1". The loadImage_*() functions won't use
d->img_icon themselves, so if the "best" icon is manually selected
using positive indexes, it won't be cached.
2025-06-12 21:31:09 -04:00
David Korth
704a5eead5 [librptexture] ICOPrivate::loadImage_WinVista_PNG(): Use res.pBestIcon->nID instead of res.id.
res.id may have accidentally worked because it was set to -1, but it's
the ID of the RT_GROUP_ICON, not the RT_ICON.
2025-06-12 21:11:41 -04:00
David Korth
783d384b04 [libromdata] EXE: Add .mui and .mun to the file extensions list.
.mui is a resource DLL used for localization.

.mun is used in Windows 10 1903+ (or possibly slightly earlier) for
icons in C:\Windows\SystemResources\ , instead of storing icons in
e.g. notepad.exe.
2025-06-12 21:07:21 -04:00
David Korth
9ca7daf9c8 [libromdata] EXE: No application icon if it's not NE/PE or not an executable.
Also, add d->file.reset() to more error paths in the constructor.
2025-06-12 21:06:01 -04:00
David Korth
c31919826b [libromdata] IsoPartitionPrivate::getDirectory(): Fix an inverted comment. 2025-06-12 20:58:57 -04:00
David Korth
bf2d3af7c3 [gettext.win32] Updated to gettext-0.25.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
Compiled with:
- i386:  gcc-15.1.0, MinGW-w64 12.0.0
- amd64: gcc-15.1.0, MinGW-w64 12.0.0

The file sizes have grown a bit. In particular, xgettext.exe grew from
1,529,344 bytes to 8,492,544 bytes. This might be related to various
gnulib updates, since libgnuintl-8.dll has a bunch of new exports
compared to 0.24.
2025-06-11 22:30:05 -04:00
David Korth
e2eede76f7 Merge branch 'feature/IsoPartition-readdir'
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
Includes:
- IsoPartition::readdir()
- ISO-9660 Joliet support
- ICO parser (for Win1.x and Win3.x)
- EXE thumbnailing (for Win1.x, Win3.x, and Win32/Win64)
- ISO thumbnailing via AUTORUN.INF
2025-06-09 23:48:08 -04:00
David Korth
e12bb51b47 [librptexture] ICOPrivate::loadImage_Win3(): Move the bitmap size check up a bit.
Some checks failed
Codecov / run (push) Has been cancelled
2025-06-09 21:05:24 -04:00
David Korth
417825cd6f [librptexture] ICO: Handle Win3.x 1bpp (monochrome) icons.
Tested by converting Win2.x BANG.ICO to Win3.x format.

ICOPrivate::loadImage_Win1():
- Note that the mask is *before* the icon.

ImageDecoder::fromLinearMono_WinIcon():
- Take separate pointers for the icon and mask data. Win3.x icons are
  typically stored upside-down, so this lets us handle that outside
  of the decoder function. This also means the image data size does
  not have to be 2x. Note that `img_siz == mask_siz` must be true.
2025-06-09 20:21:25 -04:00
David Korth
da94256a37 [xdg] mime.no-thumbnail.types: Add Windows icon/cursor MIME types.
FIXME: KDE isn't showing the ROM Properties tab on .ico files,
but Thunar and Nautilus show it just fine...
2025-06-09 20:00:09 -04:00
David Korth
222f2456fd [librptexture] ICOPrivate::loadImage_Win3(): Minor adjustment to the assertion message. 2025-06-09 19:45:04 -04:00
David Korth
11da731ef7 [librptexture] ICOPrivate::loadImage_Win3(): Add assertions for unsupported icon formats.
TODO: Need a test icon for Win3.x monochrome icons.
2025-06-09 19:43:51 -04:00
David Korth
a4efadbc56 NEWS.md: Mention issues #170 and #232. 2025-06-09 19:28:52 -04:00
David Korth
0e1a5ce237 [libromdata] ISO::loadFieldData(): Show the AUTORUN.INF fields in a new tab.
The fields are displayed as-is.

Changed autorun_inf from unordered_map<> to map<> for alphabetical sorting.
TODO: Preserve the original sort order?

TODO: Store the original key case?
2025-06-09 19:26:40 -04:00
David Korth
d557b607c2 [[libromdata] ISO: Only load the "[autorun]" section for now.
TODO: Read more sections later.
2025-06-09 19:21:47 -04:00
David Korth
1897ac198f [libromdata] ISO: Load the entire AUTORUN.INF for display purposes.
It's not displayed yet, but it's loaded.

The section names are concatenated with the key names, e.g.:
"autorun|icon"

IsoPartition::open(): Set m_lastError = ENOENT if the file isn't found.
2025-06-09 19:18:31 -04:00
David Korth
5083161c23 [librptexture] ICO: Fix regression that broke Win3.x icons; remove unneeded assert().
ICOPrivate::loadIconDirectory_Win3():
- rt == res.type *only* for Win1.x. For Win3.x, res.type is RT_GROUP_ICON
  or RT_GROUP_CURSOR. For Win1.x, it's RT_ICON or RT_CURSOR.

This fixes a regression from commit 22da0c2e21.
([libromdata] EXE: Load icons from Windows 1.x/2.x executables.)
2025-06-09 18:50:44 -04:00
David Korth
22da0c2e21 [libromdata] EXE: Load icons from Windows 1.x/2.x executables.
Windows 1.x/2.x does not have RT_GROUP_ICON. For NE executables,
check for RT_GROUP_ICON, and use it if found. Otherwise, check for
RT_ICON and use that if found.

IResourceReader: Add a function has_resource_type() to check if the
executable has any resources of the specified type.

[librptexture] ICO: Handle RT_ICON and RT_CURSOR as Windows 1.x/2.x.
TODO: Check the header to verify?
2025-06-09 18:37:47 -04:00
David Korth
8f762b7c78 ICOPrivate::ICOPrivate(): Return if the type is unrecognized.
Otherwise, dir.res will be allocated, with unpredictable results.
2025-06-09 18:30:01 -04:00
David Korth
acdf3544e1 [libromdata] NEResourceReader::lookup_resource_ID(): OR the type with 0x8000.
With Win16, the high bit needs to be set for ordinal resources.
Otherwise, it's a named resource, which we don't support right now.

Thumbnailing still worked because we were using the code path for
the "first" icon using NEResourceReader::open(), which had the
`| 0x8000` bit already.
2025-06-09 18:24:34 -04:00
David Korth
bb2e0b5e87 [kde] AchQtDBus::notifyFunc(): Fix the Qt4 build.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
2025-06-09 18:13:47 -04:00
David Korth
65a3855b98 [libromdata] NEResourceReaderPrivate::loadResTbl(): Fix an off-by-one error that broke reading resources from SkiFree 1.0.
SkiFree doesn't have any named resources, so its resource table ends
immediately after rscEndTypes. The off-by-one prevented us from
recognizing the presence of rscEndTypes.

SKI.EXE can now be thumbnailed.
2025-06-09 18:11:03 -04:00
David Korth
847342306a [libromdata] NEResourceReaderPrivate::loadResTbl(): Allow string names for now.
Some Windows 3.1 programs, e.g. CALC.EXE, have RT_GROUP_ICONs that use
string names. We need to allow this in order to thumbnail CALC.EXE.
2025-06-09 18:08:50 -04:00
David Korth
3fdd98929d [libromdata] IsoPartition: Update the "\x00" and "\x01" comments. 2025-06-08 16:10:11 -04:00
David Korth
41765be492 NEWS.md: Mention the ISO and Windows icon changes. 2025-06-08 15:53:24 -04:00
David Korth
4342ce8a1b [libromdata] ISO, IsoPartition: Simplify the Joliet escape sequence parser a bit. 2025-06-08 15:29:25 -04:00
David Korth
6e7d57282f [libromdata] ISO: Show the Joliet level.
Some checks are pending
Codecov / run (push) Waiting to run
I was considering exporting this from IsoPartition, but the IsoPartition
isn't accessible at this point. We're reading all of the volume
descriptors in checkVolumeDescriptors() anyway, so that sets a local
version of jolietSVDType, which is then checked in loadFieldData().
2025-06-08 15:00:39 -04:00
David Korth
3f1f92b18a [libromdata] IsoPartition: Add basic support for Joliet directories.
If a Supplementary Volume Descriptor is present, check for the Joliet
UCS-2 escape sequences. If found, use the SVD root directory.

Filenames in the SVD root directory are encoded in UCS-2 (big-endian).
The filename length is in bytes, not code points.

NOTE: Currently using a very cheap hack to convert UCS-2 to cp1252,
or more accurately, ISO-8859-1. It's good enough for our purposes
for now. (specifically, getting the icon from AUTORUN.INF.)

TODO: Better character set conversion.
2025-06-08 14:46:56 -04:00
David Korth
a5d22511e0 [libromdata] IsoPartition::readdir(): If there's no more non-zero bytes, return nullptr.
Otherwise, an empty IFst::DirEnt is returned.
2025-06-08 14:44:49 -04:00
David Korth
618c7c6a8d [librptexture] ICO: Fix an implicit cast warning on 64-bit MSVC.
Some checks are pending
Codecov / run (push) Waiting to run
src\librptexture\fileformat\ICO.cpp(642,11): warning C4267: '+=':
	conversion from 'size_t' to 'unsigned int', possible loss of data
2025-06-08 13:07:55 -04:00
David Korth
9a4ab48ccb [libromdata] RomDataFactory: s/exe/ext/
This fixes a Windows build regression from commit 9994c2df94.
([libromdata] RomDataFactory: Explicitly prevent ".ico" and ".cur" from being thumbnailed on Windows.)
2025-06-08 13:05:31 -04:00
David Korth
64fe76a285 [librpbase] exe_res_structs.h: Don't re-define version resource stuff if winver.h is already included.
This should fix the Windows build.
2025-06-08 13:04:12 -04:00
David Korth
993e52084d [librpbase] IResourceReader: New function lookup_resource_ID().
This function takes a zero-based index and returns a resource ID for
the given resource type if it's within range. Otherwise, it returns
a negative POSIX error code.

[libromdata] PEResourceReader, NEResourceReader: Implement it.

[libromdata] EXE: Use lookup_resource_ID for positive icon indexes.

This fixes thumbnailing for discs whose AUTORUN.INF specify a
positive, non-zero icon index.

TODO: Older discs may have truncated ISO-9660 filenames. Need to
parse Joliet file systems, maybe...
2025-06-08 12:44:35 -04:00
David Korth
55cad0ad98 [libromdata] ISO: Parse the icon index for EXE/DLL autorun icons.
The icon index can be:
- 0: First icon
- >0: Zero-based icon index
- <0: Resource ID

EXE: New function loadSpecificIcon() to load an icon given an index.
For iconindex == 0, the icon is cached in d->img_icon.

TODO: Implement a function in IResourceReader to look up a resource ID
from the zero-based index.
2025-06-08 12:23:37 -04:00
David Korth
93e78417e0 [libromdata] ISO: Load AUTORUN.INF icons from EXEs and/or DLLs.
TODO: Handle the icon index.
2025-06-08 11:54:45 -04:00
David Korth
453461e8fb [librptexture] ICOPrivate::loadImage_Win3(): Need to skip the BITMAPINFOHEADER when parsing resource icons.
This fixes the corrupted 128x128 VBoxGuestAdditions.exe icon.
2025-06-08 11:54:34 -04:00
David Korth
f5be3c81a4 [libromdata] EXE: Add icon thumbnailing using librptexture's ICO class.
Uses the first icon in the first available language.

New function loadResourceReader() which ensures rsrcReader is loaded.

[librptexture] ICO: Fix resource loading issues:

- Use the correct resource file pointer, not this->file.
- Add IconRes_Win3 and CursorRes_Win3 cases where appropriate.
- Ensure d->iconType doesn't get overwritten after it's set by the
  ICOPrivate constructor for resources.

FIXME: VBoxWindowsAdditions.exe's PNG icon loads fine, but the 128x128
"regular" icon is corrupted.
2025-06-08 11:40:59 -04:00
David Korth
9994c2df94 [libromdata] RomDataFactory: Explicitly prevent ".ico" and ".cur" from being thumbnailed on Windows.
Also add a note saying EXE shouldn't be registered for thumbnailing,
either.

This will still allow using `rpcli`, and for subclasses to use
EXE to thumbnail e.g. ISO images.
2025-06-08 11:12:06 -04:00
David Korth
6026b40df5 [libromdata] PlayStationDiscPrivate::loadSystemCnf(): Use a constant for the SYSTEM.CNF maximum size. 2025-06-08 02:33:38 -04:00
David Korth
409915591d [libromdata] ISOPrivate::loadIcon(): f_file.reset() isn't needed here. 2025-06-08 02:31:45 -04:00
David Korth
8c5888e9e5 [librptexture] ICO: Rework to support loading from Windows resources.
Some checks are pending
Codecov / run (push) Waiting to run
NOT TESTED; need to add it to the EXE class to test it.
(.ico files still work as they did before.)

Added a constructor that takes an IResourceReaderPtr and the
type/id/lang of the icon. Type should be RT_GROUP_ICON or
RT_GROUP_CURSOR. These are all saved in icodir_res.

The dir union is now initialized in the ICOPrivate constructors,
and is only reset in the ICOPrivate destructor.

loadImage_Win3(): Use a new IRpFilePtr for the icon data.
- For .ico, it's a copy of this->file.
- For Windows executables, it's opened from the IResourceReader.
- Starting address is the icon bitmap address for .ico and
  0 for IResourceReader.
2025-06-08 00:14:28 -04:00
David Korth
d0fb8dc73e [libromdata] ISO::imgpf(): Remove unused RP_D() for now, and an extra 'break;' statement.
In file included from src/libromdata/stdafx.h:63,
                 from src/libromdata/Media/ISO.cpp:10:
src/libromdata/Media/ISO.cpp: In member function ‘virtual uint32_t LibRomData::ISO::imgpf(LibRpBase::RomData::ImageType) const’:
src/libromdata/../common.h:93:45: warning: unused variable ‘d’ [-Wunused-variable]
   93 | #  define RP_D(klass) klass##Private *const d = static_cast<klass##Private*>(d_ptr)
      |                                             ^
src/libromdata/Media/ISO.cpp:984:9: note: in expansion of macro ‘RP_D’
  984 |         RP_D(const ISO);
      |         ^~~~
2025-06-07 23:30:31 -04:00
David Korth
a837c883ee [librptexture] FileFormat_decl.hpp: -'file' 2025-06-07 23:29:08 -04:00
David Korth
44ad904c71 Move IResourceReader from libromdata to librpbase.
This will allow us to use it in librptexture's ICO handler.
2025-06-07 23:26:31 -04:00
David Korth
b3b6eb5b37 [librptexture] CMakeLists.txt: Add ico_structs.h. 2025-06-07 23:19:03 -04:00
David Korth
95bcbc25fb [librptexture] ICO: Use a union of structs containing the different types of directory entries.
This is a bit cleaner than the casting method, though it is a bit messy
at points.

isResource(): Returns true if it's an icon from a resource.
(Currently not set at all...)

reset_dir_union(): Clear the directory union. Called in ICOPrivate's
destructor and various error paths.

TODO: Add resource loading. May need to move IResourceReader from
libromdata to librpbase.
2025-06-07 23:15:15 -04:00
David Korth
821155bd83 [librptexture] ICO: Initial reworking to handle icons from .exe/.dll resources.
ICONDIR and GRPICONDIR are basically the same, but ICONDIRENTRY and
GRPICONDIRENTRY have different sizes. Use an rp::uvector<uint8_t>
and casting to handle this.

Still only supports .ico files for now.
2025-06-07 23:09:45 -04:00
David Korth
e765792ebb [libromdata] ISO: Initial support for AUTORUN.INF icons.
Limitations:
- Only supports .ico, not .exe.
- The filename must match the ISO-9660 filename. Some older Win9x
  discs use a long filename in AUTORUN.INF that's only listed as
  such in the Joliet extension.

Removed some debugging code from the IsoPartition readdir()
implementation testing from earlier.
2025-06-07 22:38:31 -04:00
David Korth
194b3dcf61 [librptexture] fromLinearCI8(): Require 32-bit palettes for all Host_* and Swap_* formats.
TODO:
- More formats?
- Add a table mapping pixel format to bpp?
2025-06-07 22:05:56 -04:00
David Korth
8378697be1 [librptexture] ICOPrivate::loadImage_Win3(): Use Host_ARGB32, not Host_xRGB32, for the palette.
fromLinearCI4() doesn't support Host_xRGB32, and we're filling
in the alpha channel ourselves.

TODO: Add Host_xRGB32 support to fromLinearCI4()?
fromLinearCI8() supports it...

This fixes a regression from commit de802835f7.
([librptexture] ICO: Handle 8-bit color icons.)
2025-06-07 22:03:17 -04:00
David Korth
1caf44d15e [librptexture] ICO: Select the best icon image.
First, the image size is checked. If either width or height are larger
than the previously-selected image, this image is picked. Otherwise,
if the size is identical (both width and height), and bitcount is
higher, then the image is selected.

TODO: Better non-square icon handling? (Use "largest area"?)
2025-06-07 21:50:37 -04:00
David Korth
fbdeae25a5 [librptexture] ICO: Load all of the icon bitmap headers.
Next step is to actually go through them and pick the "best" one.
2025-06-07 21:35:16 -04:00
David Korth
de802835f7 [librptexture] ICO: Handle 8-bit color icons.
- Forgot to move convimg to img when converting from CI8 to ARGB32.

- Make sure sBIT is updated with alpha=1. Otherwise, RpPng::save()
  will tell libpng that there's no alpha, so the resulting PNG image
  saved using `rpcli -x3` won't be transparent.
2025-06-07 21:27:47 -04:00
David Korth
1c96133917 [librptexture] ICO: Divide the bitmap height by 2 for d->dimensions[1].
The ICONDIR height is correct, but the bitmap height is double-sized
because it includes the mask.
2025-06-07 21:19:54 -04:00
David Korth
d01201a184 [librptexture] ICO: Save the icon image header and get sizes for BITMAPCOREHEADER and PNG.
iconHeader is now saved in the private class instead of being loaded
in loadImage_Win3().

The dimensions are now set correctly when an icon's "best" image is
in PNG format.

ico_structs.h: Add PNG chunks.
2025-06-07 21:15:50 -04:00
David Korth
f6e5229b72 [librptexture] ICO: Load PNG-format icon images.
FIXME: Dimensions are still incorrect, since the ICONDIR dimensions
are 0 for 256x256. We should get the dimensions from IHDR instead.
2025-06-07 21:04:18 -04:00
David Korth
fe85d93fc3 [librptexture] ICOPrivate::loadImage_Win3(): Add support for 32-bit ARGB icons.
NOTE: BI_BITFIELDS is not supported right now. (Is that even used for
32-bit ARGB, or is it for 16/24 only?)

Fix mask handling for 48x48 icons by aligning stride to 32-bit.
2025-06-07 20:52:45 -04:00
David Korth
7edb6df2e4 [librptexture] ICOPrivate::loadImage_Win3(): Apply the icon mask for 8bpp and higher icons.
NOTE: Not tested yet!

Remove an unused variable that was used when debugging masks.
The variable counted the number of mask bytes that were processed.
2025-06-07 20:25:16 -04:00
David Korth
eb5300413b [librptexture] ICOPrivate::loadImage_Win3(): Apply the icon mask for 1bpp, 2bpp, and 4bpp icons.
For these icons, an extra transparent color is added.

The image is flipped *after* the mask is applied because the mask is
also upside-down.

TODO:
- Set sBIT.
- Apply the icon mask for CI8 and higher-color icons. (CI8 will need to
  be converted to ARGB32.)
2025-06-07 20:21:22 -04:00
David Korth
37dd0c3ffe [librptexture] ICOPrivate::loadImage_Win3(): Fix mask_data address for upside-down bitmaps.
This seems to place the mask image at the top of the image once it's
flipped, but maybe it's that it's technically two bitmaps and not
one giant bitmap.

TODO: Test it with a right-side up icon.
2025-06-07 20:18:10 -04:00
David Korth
af2c512181 [librptexture] ICO: Initial support for Windows 3.x icons.
The entire icon directory is loaded, but currently the first icon is
loaded instead of selecting the "best" icon.

NOTE: Windows Vista and later determines the "best" icon by looking at
the BITMAPINFOHEADER, not the icon directory. We'll do that too.

loadImage_Win3(): Added support for loading 16-color icons, including
the palette (color table). The mask is loaded, but it isn't applied
yet.

TODO:
- Support more icon formats.
- Apply the mask.
- Determine if the mask isn't present? (e.g. in 32-bit icons)
2025-06-07 19:57:19 -04:00
David Korth
b02a2b8009 [librptexture] ICO: Remove duplicated code from the Qoi handler.
I used Qoi.cpp as a base for ICO.cpp.
2025-06-07 18:29:09 -04:00
David Korth
081d4a4b87 [librptexture] fromLinearMono_WinIcon(): Use white for INVERT.
This at least allows it to show up at all, whereas before it was
showing up as completely transparent.
2025-06-07 18:27:26 -04:00
David Korth
776998d0ed [librptexture] ImageDecoder_Linear_Gray.cpp: New function fromLinearMono_WinIcon().
This converts the Windows 1bpp icon using the mask for transparency.
(Inversion is *not* supported.)

Also, 0 == black, 1 == white. This is the opposite of fromLinearMono(),
which is mostly used for things like VMU icons.

TODO: Handle upside-down images. Win1.x icons and cursors are
right-side up, but Win3.x is upside-down.

ICOPrivate::loadImage_Win1(): Call fromLinearMono_WinIcon().

Tested with the Windows 2.0 DDK icons and cursors, and all of them
appear to be decoding correctly.
2025-06-07 18:24:42 -04:00
David Korth
e84ccfd53d [librptexture] ICO: Initial Windows Icon decoder.
This will eventually be used for ISO image thumbnailing, though it might
also be useful on some other systems.

Linux desktop environments typically have their own ICO thumbnailer.

NOTE: This might still be useful even if the system supports ICO:
- 64-bit Windows cannot read 16-bit Windows executables.
- No current Windows version supports Windows 1.x icons.
- Linux thumbnailers typically don't support Windows 1.x icons, either.

This implementation currently *only* supports Windows 1.x icons, and
doesn't handle masking.

TODO: ImageDecoder::fromLinearMono_WinIcon()?

NOTE: Icon MIME types haven't been added to the XDG files yet, so they
won't be thumbnailed yet (or, more likely, conflict with the system
thumbnailer).
2025-06-07 18:18:24 -04:00
David Korth
e2f0b41964 [libromdata] IsoPartitionPrivate::lookup_int(): Validate isDir in the exact-length match block. 2025-06-07 17:01:13 -04:00
David Korth
c65ea8c0ed [libromdata] IsoPartitionPrivate::getDirectory(): Fail if the entry isn't a directory.
Otherwise, it might try to load the file data as if it's a directory,
which would result in weird shenanigans.
2025-06-07 16:58:07 -04:00
David Korth
988df314e6 [libromdata] IsoPartition: New function sanitize_path() to remove leading and trailing slashes.
This fixes opendir("/NT3x/") for VBoxGuestAdditions.iso.

Note that this may be slightly slower than the old method due to string
copying, but it's much cleaner.

findLastSlash(): Now uses an internal function with a `size` parameter,
and has two wrapper functions: one for `const char*`, and one for
`std::string`.
2025-06-07 16:55:28 -04:00
David Korth
a49fb884f1 [libromdata] IsoPartition: Optimize findLastSlash() by searching for '/' and '\\' at the same time instead of calling strrchr() twice. 2025-06-07 16:39:46 -04:00
David Korth
c7ccd7a39a [librpbase] IsoPartition: Implement opendir(), readdir(), and closedir().
Tested using VBoxGuestAdditions.iso from VirtualBox 7.1.8.

Skip subdirectories with names "\x00" and "\x01". These are Joliet
"special directory identifiers".

IFst:
- Change `dir_idx` from int to intptr_t.
- Add two explicit constructors with a `dir_idx` parameter.
  One takes intptr_t; the other takes void*.
- Added an `extra` parameter for temporary filename storage.
  The ISO-9660 directory entry does not have NULL termination for
  the filename, so we need the temporary buffer to add the terminator.

GcnFst, WiiUFst:
- Update for the `dir_idx` constructor parameter.
- Zero out the `extra` parameter.

TODO:
- Move it to a new IFst subclass, IsoFst?
- Remove the file version number, e.g. ";1"?
- Handle "/NT3x/". Currently, "/NT3x" works, but the trailing slash
  confuses the directory lookup function.
- Joliet subdirectory support?
2025-06-07 16:34:00 -04:00
David Korth
6b30dd5b70 [libromdata] IsoPartition: Mark findLastSlash() and parseTimestamp() as static.
They don't depend on any data in IsoPartitionPrivate.

TODO: HSFS/CDI support?
2025-06-07 15:52:29 -04:00
David Korth
5ed38edbec [libromdata] IFst::readdir(): Return const DirEnt* instead of DirEnt*.
This ensures the caller won't modify the DirEnt.

Note that this doesn't match POSIX readdir(), but we don't need to
strictly match it. (We're also not returning `struct dirent*`; we're
returning a custom one.)
2025-06-07 15:47:30 -04:00
David Korth
b884747254 [librpbase] IFst.hpp: Un-indent the class definition. 2025-06-07 15:27:05 -04:00
David Korth
1aad707f88 [libromdata] WiiUPackagePrivate::addFields_System_XMLs(): Use C strings instead of C++ strings for the XML keys.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
Reduces memory usage slightly and probably improves performance a bit,
since we don't have to manage buffer sizes.

Code size differences: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  15953     288       0   16241    3f71 WiiUPackage_xml.cpp.o [before]
  13376     288       0   13664    3560 WiiUPackage_xml.cpp.o [after]
  -2577       0       0   -2577    -a11 Difference
2025-06-07 15:25:51 -04:00
David Korth
5fd65dc7e2 [kde] AchQtDBus::notifyFunc(): Use QString::arg() for the text.
It's slightly less efficient than manually building the string, but
this lets us reformat the text more easily later on, if needed.

Code size differences: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  14174      72       5   14251    37ab AchQtDBus.cpp.o [kf5] [before]
  14221      72       5   14298    37da AchQtDBus.cpp.o [kf5] [after]
    +47       0       0     +47     +2f Difference

   text    data     bss     dec     hex filename
  12995     200       5   13200    3390 AchQtDBus.cpp.o [kf6] [before]
  13164     200       5   13369    3439 AchQtDBus.cpp.o [kf6] [after]
   +169       0       0    +169     +a9 Difference
2025-06-07 15:20:22 -04:00
David Korth
50ae166484 [kde] RpQt.hpp: New function Q2U8_StdString().
On Qt5 and Qt6, QString::toStdString() converts the string to a UTF-8
std::string, so this simply wraps around that.

On Qt4, QString::toStdString() uses QString::toAscii(), so instead,
we use QString::toUtf8().constData() and convert that into an std::string.

This is more efficient when saving to an std::string, since Q2U8() only
returns the data pointer, which makes it an implicit-length C string.

Q2U8_StdString() is now used wherever an std::string needs to be saved.

Updated all other uses to use Q2U8() instead of QString::toUtf8().constData().

FIXME: RpFileKio::filename():
- Q2U8() returns a temporary, which may be gone by the time this function
  returns...

Code size differences: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  30982    1648      48   32678    7fa6 kfilemetadata_rom-properties-kf5.so [before]
  30846    1648      48   32542    7f1e kfilemetadata_rom-properties-kf5.so [after]
   -136       0       0    -136     -88 Difference

   text    data     bss     dec     hex filename
  26844    1456      48   28348    6ebc overlayiconplugin_rom-properties-kf5.so [before]
  26726    1456      48   28230    6e46 overlayiconplugin_rom-properties-kf5.so [after]
   -118       0       0    -118     -76 Difference

   text    data     bss     dec     hex filename
 599947   21896      64  621907   97d53 rom-properties-kf5.so [before]
 600363   21896      64  622323   97ef3 rom-properties-kf5.so [after]
   +416       0       0    +416    +1a0 Difference

   text    data     bss     dec     hex filename
  55979    2824      48   58851    e5e3 RomThumbnailCreator-kf5.so [before]
  55795    2824      48   58667    e52b RomThumbnailCreator-kf5.so [after]
   -184       0       0    -184     -b8 Difference

   text    data     bss     dec     hex filename
  78593    5144      48   83785   14749 xattrview-kf5.so [before]
  78546    5152      48   83746   14722 xattrview-kf5.so [after]
    -47      +8       0     -39     -27 Difference

   text    data     bss     dec     hex filename
  33049    1760      48   34857    8829 kfilemetadata_rom-properties-kf6.so [before]
  32497    1752      48   34297    85f9 kfilemetadata_rom-properties-kf6.so [after]
   -552      -8       0    -560    -230 Difference

   text    data     bss     dec     hex filename
  28794    1584      48   30426    76da overlayiconplugin_rom-properties-kf6.so [before]
  28350    1568      48   29966    750e overlayiconplugin_rom-properties-kf6.so [after]
   -444     -16       0    -460    -1cc Difference

   text    data     bss     dec     hex filename
 595782   29168      80  625030   98986 rom-properties-kf6.so [before]
 595959   29176      80  625215   98a3f rom-properties-kf6.so [after]
   +177      +8       0    +185     +b9 Difference

   text    data     bss     dec     hex filename
  61854    3352      48   65254    fee6 RomThumbnailCreator-kf6.so [before]
  61649    3360      48   65057    fe21 RomThumbnailCreator-kf6.so [after]
   -205      +8       0    -197     -c5 Difference

   text    data     bss     dec     hex filename
  76033    6224      48   82305   14181 xattrview-kf6.so [before]
  75690    6216      48   81954   14022 xattrview-kf6.so [after]
   -343      -8       0    -351    -15f Difference
2025-06-07 15:15:42 -04:00
David Korth
6577715f73 [librpbase] APNG_dlopen.h: Don't export APNG_ref() and APNG_unref().
It's only used by librpbase internally.

This is technically an ABI break, even though these functions weren't
used outside of librpbase, so bump the SOVERSION to 7.
2025-06-07 14:38:47 -04:00
David Korth
2c17a8e727 [libgsvt] gsvt_win32.c: Clear bold and bright when setting "normal" intensity. (SGR 22) 2025-06-07 14:16:33 -04:00
David Korth
cff7086b3d [libromdata] CisoPspDlopen.cpp: Define PTHREAD_ONCE_INIT on Windows.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
2025-06-05 23:25:05 -04:00
David Korth
981c173142 [libromdata] CisoPspDlopen.hpp: Need to typedef int pthread_once_t on Windows.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
Normally this would be in pthread_once.h, but we're not using the
standard version due to calling a class member function.
2025-06-04 13:33:21 -04:00
David Korth
df719e959a [libromdata] CisoPspDlopen.hpp: Fix build warnings and errors in no-LZ4/no-LZO builds.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
NOTE: Disabling LZ4 and LZO entirely prevents the libraries from
being loaded at all. This currently results in CISOv2 images that
partially load, but fail when an LZ4-compressed block is encountered.
2025-06-04 10:48:41 -04:00
David Korth
3af7964b0c [librpthreads] pthread_once.c: Use sched_yield() for consistency.
Windows doesn't have either function. Instead, we end up calling
SwitchToThread().
2025-06-04 10:34:52 -04:00
David Korth
723712102a [libromdata] CisoPspDlopen: Use an implementation of pthread_once() to initialize the libraries.
We can't use standard pthread_once() here due to the use of member
functions. Instead, we're using a macro that simulates it, based on
the Windows version in pthread_once.c.

NOTE: Still using the standard pthread_once_t type, which is `long`
on Linux systems.

[librpthreads] CMakeLists.txt: Check for sched_yield().
pthread_yield() is deprecated as of glibc-2.34.

If sched_yield() isn't found, define it as pthread_yield().
2025-06-04 10:31:51 -04:00
David Korth
3416f16ad2 [libromdata] CisoPspDlopen: Remove some debugging printf()'s. 2025-06-04 10:13:46 -04:00
David Korth
3db391e8c1 [libromdata] CisoPspReader: Make the CisoPspDlopen object static.
This will make it so only one initialization is needed if using a single
libromdata.so load to read multiple PSP images.

NOTE: CisoPspDlopen isn't thread-safe at this point. Need to use
pthread_once() for initialization.
2025-06-04 10:12:37 -04:00
David Korth
4ab931b127 [libromdata] CMakeLists.txt: Bump the SOVERSION to 6.2.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
It's ABI-compatible with 6.0 and 6.1 (using only .so.6, not .so.6.2),
but there have been changes since the previous release.
2025-06-03 22:54:55 -04:00
David Korth
e1ef6e6d2f [libromdata] CisoPspDlopen: Split the dlopen() code from CisoPspreader into a separate class. 2025-06-03 22:54:42 -04:00
David Korth
e9625cb876 [libromdata] CisoPspReaderPrivate::init_pfn_LZO(): LZO, not LZ4. 2025-06-03 22:53:19 -04:00
David Korth
79c3a2e34d [libromdata] dlopen-notes.c: Add liblz4.so.1 and liblzo2.so.2 to the dlopen() notes section.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
2025-06-02 22:52:13 -04:00
David Korth
8650f2b1c2 [debian] control: Add liblz4-1 and liblzo2-2 as explicit dependencies to libromdata6.
These are now dlopen()'d, so ${shlibs:Depends} won't detect them.

NOTE: Newer versions of Debian tools might detect them if we add
dlopen() notes.
2025-06-02 22:43:12 -04:00
David Korth
e2f4ddde72 [libromdata] CisoPspReader: Dynamically load the LZO library using dlopen().
TODO: Keep the dlopen()'d libraries around for multiple uses?
May need to create a helper class...
2025-06-02 20:29:35 -04:00
David Korth
88a9a603ce [libromdata] CisoPspReader::CisoPspReader(): Missed a HAVE_LZ4. 2025-06-02 19:57:11 -04:00
David Korth
60b18c408f [libromdata] CisoPspReader: Dynamically load the LZ4 library using dlopen().
LZ4 is only used by CisoPspReader, so there's no need to load it on
startup on Linux systems. Instead, use dlopen().

Remove the various `#ifdef HAVE_LZ4` checks.

TODO: Show a warning if the image requires LZ4 but we don't have it.
For now, it just says the image couldn't be opened.

On Windows, we're switching from DelayLoad to LoadLibrary() for
consistency.

[libwin32common] DelayLoadHelper.h: Export rp_LoadLibrary().
This is used by CisoPspReader to load lz4.dll.

The exported version does not do a DLL whitelist check, whereas
the version used by the MSVC exception handler does.
2025-06-02 19:42:16 -04:00
David Korth
ed799a1cc2 [rp-download] rp-download.cpp: recvmmsg() is needed by cURL 8.13 for QUIC (HTTP/3).
Noticed this on my local system after updating from cURL 8.12 to 8.13:

$ /usr/libexec/rp-download -v sys/version.txt
URL: https://rpdb.gerbilsoft.com/sys/version.txt
Cache Filename: /home/user/.cache/rom-properties/sys/version.txt
Cache file for 'sys/version.txt' is already downloaded, but this cache key is set to download-if-newer.
SYSCALL TRAP: [amd64] recvmmsg()
Segmentation fault
2025-06-02 19:40:56 -04:00
David Korth
407fb36461 [libpng] Disable /guard:cf in MSVC builds for now.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
This is what was causing the libpng crash in png_longjmp() on
Windows 10 in MSVC 2022 release builds.

See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
Reported by @Masamune3210.
2025-05-26 11:11:51 -04:00
David Korth
55fac18b76 [librptext/tests] TextFuncsTest: Add fourCC tests.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
For both the char* version and the std::string version.

Code coverage change:

Before:
  source files: 607
  lines.......: 24.1% (11442 of 47453 lines)
  functions...: 24.0% (910 of 3786 functions)
  branches....: 17.0% (8352 of 49177 branches)

After:
  source files: 607
  lines.......: 24.1% (11450 of 47453 lines)
  functions...: 24.1% (911 of 3786 functions)
  branches....: 17.0% (8353 of 49177 branches)
2025-05-25 16:08:03 -04:00
David Korth
440bb7aeb5 Increase minimum CMake versions to "3.5...3.10".
CMake 4.0 drops compatibility with versions older than 3.5, and warns
that compatibility with < 3.10 will be dropped in a "future version".

CMake 3.30 previously warned about dropping support for older than
3.5, which was changed in 3.31 to older than 3.10.
2025-05-25 15:39:40 -04:00
David Korth
c0c8b2582c CMakeLists.txt: Enable policy CMP0177 if it's available.
This fixes a bunch of warnings similar to the following:

CMake Warning (dev) at src/kde/kf5/CMakeLists.txt:370 (INSTALL):
  Policy CMP0177 is not set: install() DESTINATION paths are normalized.  Run
  "cmake --help-policy CMP0177" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.
2025-05-25 15:29:54 -04:00
David Korth
7e51a47609 [libromdata] NES: Some FDS images have Heisei era years, starting at 01.
Assume anything <=57 is Heisei, and >=58 (1983) is Shōwa.

NOTE: The FDS was released in 1986, but we'll allow for 1983 just in case
there was an FDS game in development in 1985. (Maybe the lower bound
should be 1985 instead...)
2025-05-25 15:26:01 -04:00
David Korth
b72bd8a436 [extlib] Skip installation of binaries for minizip-ng.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
FIXME: The minigzip and minizip binaries are automatically built,
even though we use SET_EXTLIB_PROPERTIES(), which should exclude
them from ALL builds...
2025-05-25 00:35:04 -04:00
David Korth
7d6c7064d2 [libromdata] Xbox360_STFS_Private::getTitle(): Remove mojibake_chars.
I was originally going to use a lookup table, but decided to use
switch/case instead. I never removed the lookup table, though...
2025-05-24 15:13:05 -04:00
David Korth
065c86149a NEWS.md: Update the Xbox360_STFS mojibake description.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
2025-05-24 15:08:28 -04:00
David Korth
32ac318236 [libromdata] Xbox360_STFS_Private::getTitle(): It's all UTF-8.
The Shift-JIS thing was incorrect, even with the U+0081 code point.
It's all UTF-8 that was incorrectly converted from cp1252 to UTF-16BE.

Also, remove a redundant string conversion that I was using earlier for
debugging purposes and is no longer needed.
2025-05-24 15:06:47 -04:00
David Korth
5de651dbbe [libromdata] Xbox360_STFS: Fix titles for some packages that were authored incorrectly and have mojibake titles.
Two types of mojibake are detected and fixed:
- UTF-8 parsed as cp1252
- Shift-JIS parsed as cp1252

For the latter case, utf16_to_cp1252() on Linux (and other systems that
use iconv) has been modified to handle five code points that iconv()
doesn't support: 0x81, 0x8D, 0x8F, 0x90, 0x9D.

TODO: Also do this for utf8_to_cp1252() and other cp1252 functions?

On Windows, WideCharToMultiByte() and MultiByteToWideChar() handle these
code points without any issues.

These three title updates now show a correct title:

TU_11LK1UV_0000004000000.0000000000081 (UTF-8 as cp1252)
Name:  'Dodonpachi Daifukkatsu Black Label Title Update #1'
Title: '怒首領蜂 大復活 Black Label'

TU_12501VG_0000004000000.0000000000101 (UTF-8 as cp1252)
Name:  'DREAM C CLUB Title Update #4'
Title: 'ドリームクラブ'

TU_15LG1UH_000000C000000.0000000000083 (Shift-JIS as cp1252)
Name:  'Circle of Students Title Update #1'
Title: '円卓の生徒'

Fixes #450: X360 - Non-Latin Titles appearing as mojibake
Reported by @Masamune3210.
2025-05-24 15:02:21 -04:00
David Korth
34f76050cb [librpbase] RpPng: Work around a potential libpng crash when attempting to read empty data as a PNG image.
Check the magic number before initializing libpng.

It seems there's something wrong with MSVC 2022 (17.6.5) that causes a
release build of libpng to crash when calling longjmp() on Windows 10.

If this is in fact a compiler bug, and upgrading the compiler fixes it,
then I'll need to switch away from my Windows 7 VM because MSVC 17.6 is
the last version to support Windows 7 as a build environment.

See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
Reported by @Masamune3210.
2025-05-24 13:53:47 -04:00
David Korth
223cee6c9c [librpbase/tests, libromdata/tests] Hexdumps: Add an extra space after the offset. 2025-05-22 23:49:10 -04:00
David Korth
fc44e1da01 [librptext] formatFileSize(): TODO: Have the UI frontend set the "default" dialect, e.g. using kdeglobals on KDE.
For now, defaulting to IEC. (Same as before, but now more explicit.)
2025-05-22 18:29:28 -04:00
David Korth
7c96eb5381 [libgsvt] gsvt_win32.c: Fix vt->bold initialization.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
2025-05-20 21:34:40 -04:00
David Korth
54a7b12523 [libgsvt] gsvt_win32_console_print_ANSI_emulate(): xterm supports BEL (\007) in addition to ST for ending an OSC sequence.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
2025-05-17 14:42:04 -04:00
David Korth
443df8a7ab [libgsvt] gsvt_init_win32(): Set bold if the initial attributes have FOREGROUND_INTENSITY set. 2025-05-17 14:39:42 -04:00
David Korth
86638f478c [xdg] rom-properties.xml: Add GameCube/Wii executables (.dol).
.dol files aren't currently supported by rom-properties. shared-mime-info
is misidentifying them as image/vnd.microsoft.icon, which is clearly
wrong, so add this to fix the identification.
2025-05-17 14:36:18 -04:00
David Korth
55cb219a17 [rp-download] Set an "Accept:" header for the expected MIME type.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
Expected MIME types:
- .png: image/png
- .jpg: image/jpeg
- .txt: text/plain

Not sure if this will make any real difference, but we might as well
set it anyway.
2025-05-17 13:17:45 -04:00
David Korth
05f08c2d32 [librpbyteswap] byteswap_rp.h: Can't mark __swabf() as constexpr on MSVC.
__swab32(), aka _byteswap_ulong(), is *still* not constexpr on MSVC.
2025-05-17 13:02:38 -04:00
David Korth
8e841026e9 [minizip-ng] CMakeLists.txt: Don't check for ZLIB/ZLIBNG.
zlib is already checked earlier. On my system, since I have zlib-ng
installed system-wide, this check picks it up, and causes libromdata.so.6
to be linked to libz-ng.so.2.

Disabling the check removes that linkage.

NOTE: The Ubuntu packages for 2.5 and 2.5.1 are *not* linked to zlib-ng,
since Ubuntu doesn't have zlib-ng included by default.

Also, update _MODIFIED_MINIZIP.txt for 4.0.10. (Forgot to do this when
updating from 4.0.9 to 4.0.10.)
2025-05-13 22:47:38 -04:00
David Korth
46c83d92c1 Rework CONSTEXPR_IF_MSVC2022 into CONSTEXPR_MULTILINE and CONSTEXPR_MULTILINE_NO_MSVC.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
gcc-4.9 on Debian 8 doesn't support multi-line constexpr functions.

CONSTEXPR_MULTILINE enables constexpr for MSVC 2022 and gcc-5,
and later versions.

CONSTEXPR_MULTILINE_NO_MSVC enables constexpr for gcc-5 and later,
but not MSVC. Needed for functions that use intrinsics, which
(still) aren't marked as constexpr on MSVC.
2025-05-12 21:34:55 -04:00
David Korth
44eba93a3e Remove some old FIXMEs and TODOs.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
2025-05-11 12:35:38 -04:00
David Korth
ade40a4965 [libromdata] IntellivisionPrivate::getTitle(): Handle characters 0x3E and 0x3F correctly.
These correspond to U+2191 UPWARDS ARROW and U+2190 LEFTWARDS ARROW,
respectively.
2025-05-11 11:46:03 -04:00
David Korth
0f2eccd3ac [librptexture] ImageSizeCalc.hpp, validateBlockSizeASTC(): Rework into a single-line constexpr() function.
Remove the assertions, since they aren't very useful. They'd only assert
if the file is corrupted.

TODO: Validate combinations?
2025-05-11 11:21:24 -04:00
David Korth
99942e6a04 rp-libfmt.h: Add a to_tstring() macro.
NOTE: `using` statements within `namespace fmt` didn't work:
src\rp-libfmt.h(48,21): error C2061: syntax error: identifier 'to_wstring'

[win32] RomDataFormat.cpp, ImageTypesTab.cpp: Use fmt::to_tstring().
2025-05-11 11:11:10 -04:00
David Korth
1912c62551 [libromdata/tests] GcnFstPrint, WiiUFstPrint: Add colorization for error and warning messages. 2025-05-11 11:04:32 -04:00
David Korth
43a7bd4a49 [libromdata/tests] GcnFstPrint, WiiUFstPrint: Use libgsvt.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
The Unicode text printing on Windows via _fputts() was causing the
console output to lock up on Windows 7. Switching to libgsvt fixes it.

Code size difference: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16247    1032      48   17327    43af GcnFstPrint [before]
  19006    1160      80   20246    4f16 GcnFstPrint [after]
  +2759    +128     +32   +2919    +b67 Difference

   text    data     bss     dec     hex filename
  15417    1016      48   16481    4061 WiiUFstPrint [before]
  18210    1144      80   19434    4bea WiiUFstPrint [after]
  +2793    +128     +32   +2953    +b89 Difference
2025-05-11 04:13:24 -04:00
David Korth
665a9f878c [locale] fr.po: Translate Ext2AttrView's placeholders by adding a space before the colon. 2025-05-11 03:47:23 -04:00
David Korth
94470e319a [kde] Use QC_() for translation, not QObjectDerivedClass::tr().
The xgettext call in locale/CMakeLists.txt doesn't detect
QObjectDerivedClass::tr(). Because of this, we ended up missing
a few strings for translation.

[locale] Update with the missed strings.
2025-05-11 03:46:48 -04:00
David Korth
9a5550f1f5 [locale] Update rom-properties.pot and *.po.
Forgot to do this for the v2.5.1 release...
2025-05-11 03:39:18 -04:00
David Korth
f13bde810f [librptexture] ImageDecoder::fromLinear32_ssse3(): Missed a 16-byte stride alignment check.
xtexconv includes a sample DDS that has stride == 15,076. Without this
check, rpcli crashes due to the use of movdqa on an unaligned pointer.

Reference: https://learn.microsoft.com/en-us/samples/microsoft/xbox-gdk-samples/xtexconv/
2025-05-11 03:20:44 -04:00
David Korth
f6d9394da8 [libgsvt] gsvt_win32.c, gsvt_win32_console_print_ANSI_emulate(): RESET command should update bold.
`bold` should be set to true if wAttributes has FOREGROUND_INTENSITY.
2025-05-11 02:36:16 -04:00
David Korth
a83c05459d [libgsvt] gsvt_win32.c: Get rid of an unnecessary #ifdef _WIN32. 2025-05-11 02:33:59 -04:00
David Korth
18b7ec55d3 [libgsvt] gsvtpp.cpp: Remove the struct _gsvt_console definition.
I added this here for testing purposes in order to verify that the
consoles were initialized properly. It isn't needed here anymore.
2025-05-11 01:22:49 -04:00
David Korth
53648f1ffa Merge branch 'feature/libgsvt' 2025-05-11 01:18:23 -04:00
David Korth
03df42456c Multi-line constexpr functions are only supported as of MSVC 2022.
Some checks are pending
Codecov / run (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
New macros:
- CONSTEXPR_IF_MSVC2022: constexpr for MSVC 2022 and later (also gcc).
- CONSTEXPR_NO_MSVC: no constexpr on any MSVC (but yes on gcc).

Use CONSTEXPR_IF_MSVC2022 on multi-line constexpr functions.

Use CONSTEXPR_NO_MSVC on functions that can be constexpr on gcc but
not any version of MSVC.
2025-05-11 00:58:11 -04:00
David Korth
d241d33537 NEWS.md: Mention more rpcli colorization and libgsvt refactoring. 2025-05-11 00:44:33 -04:00
David Korth
e495796ee8 [rpcli] verifykeys.cpp: Missed a gsvt_fputs() conversion.
Code size difference: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  45968    2176     416   48560    bdb0 rpcli [before]
  45904    2176     416   48496    bd70 rpcli [after]
    -64       0       0     -64     -40 Difference
2025-05-11 00:41:31 -04:00
David Korth
e81f24cc39 [libgsvt] Added a gsvt_fflush() wrapper function.
Also Gsvt::Console::fflush().

[rpcli] rpcli.cpp, verifykeys.cpp: Use Gsvt::Console::fflush().

verifykeys.cpp: Only call fflush() at the end of the function.

Code size difference: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  45929    2168     432   48529    bd91 rpcli [before]
  45968    2176     416   48560    bdb0 rpcli [after]
    -39      +8     -16     -31     -1f Difference
2025-05-11 00:37:08 -04:00
David Korth
381980d13e [libgsvt] gsvtpp: New C++ wrapper class.
Gsvt::StdOut and Gsvt::StdErr are predefined as wrappers around
gsvt_stdout and gsvt_stderr.

Accessing either of the wrapper classes automatically calls gsvt_init().

gsvt_posix.c, gsvt_win32.c: Rework gsvt_init() to use pthread_once() so
multiple initializations won't cause problems.

[rpcli] rpcli.cpp, verifykeys.cpp: Use gsvtpp.

This does increase the code size a tiny bit...

Code size difference: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  45810    2152     416   48378    bcfa rpcli [before]
  45929    2168     432   48529    bd91 rpcli [after]
   +119     +16     +16    +151     +97 Difference
2025-05-11 00:30:53 -04:00
David Korth
23f71c4f9c [rpcli] rpcli.cpp: Use the C++ string version of gsvt_fputs() on Windows.
This function calls gsvt_write() internally.
2025-05-11 00:15:51 -04:00
David Korth
78da45fb5d [rpcli] rpcli.cpp: Colorize more warnings. 2025-05-10 23:44:02 -04:00
David Korth
f2c3b6c5ba [rpcli] rpcli.cpp: Improve language code handling.
- Convert the language code from uppercase to lowercase.

- After the conversion, make sure that the language code is all
  lowercase characters.

- Colorize the warning message in yellow.

ctypex.h:

- Use `int` instead of `char` in the non-localized functions. This
  ensures Windows TCHAR works properly without getting truncated.

- New functions toupper_ascii() and tolower_ascii().
2025-05-10 23:27:36 -04:00
David Korth
d5ede2ee5b [rpcli] Remove vt.cpp.
libgsvt now has all of its functionality.
2025-05-10 23:07:28 -04:00
David Korth
23c473e5e3 [rpcli] verifykeys.cpp: Update to use libgsvt instead of rpcli's vt.hpp. 2025-05-10 23:05:47 -04:00
David Korth
1f856117ec Move Win32 console output code page handling from rpcli.cpp to libgsvt/gsvt_win32.c. 2025-05-10 23:05:47 -04:00
David Korth
3efdc825d9 [libgsvt] Optimize gsvt_text_color_set8().
- POSIX: Use fprintf().
- Win32: Use WriteConsoleA() if it's a real console.
2025-05-10 23:05:47 -04:00
David Korth
611fea3782 [libgsvt] gsvt_win32.c: Windows implementation.
Mostly copied from rpcli's vt.cpp, but with a few changes. In particular:

- gsvt_fwrite() and gsvt_fputs() are wrappers around the ANSI emulation
  code, *if* ANSI isn't supported and it's a real console.

- The ANSI emulation code no longer resets attributes after data is
  written, since we might make multiple calls with color changes.

[rpcli] rpcli.cpp: Simplify the Windows-specific code.

Instead of checking if the console is a console, just use gsvt_fwrite().
gsvt_fwrite() will handle this.

FIXME: gsvt_cout wrapper so we can get rid of this.
2025-05-10 23:05:47 -04:00
David Korth
44608520b8 Initial refactoring of rpcli's VT code into a separate library.
Currently for Linux only. The Linux implementation is mostly just
wrapper functions around stdio.

gsvt_fputs() does not have a `newline` parameter, so anything that
used ConsolePrint()'s `newline` parameter now has to explicitly
call gsvt_newline().
2025-05-10 23:05:47 -04:00
David Korth
0328879a01 [rpcli] verifykeys.cpp: Remove some extra newlines.
Forgot to remove these when colorizing warning messages in
commit 365a7d5302.
([rpcli] verifykeys.cpp: Colorize output.)

Affects: v2.5.1
2025-05-10 23:05:47 -04:00
David Korth
53b74e0467 [debian] rules: Explicitly specify the Tracker API version, again.
Otherwise, we have to install the specific Tracker library, which is
versioned, so we end up with more problems.

(cherry picked from commit 1356d23d4c)
2025-05-10 21:04:30 -04:00
David Korth
c632a35c62 Version bump for development. (v2.5.1+) 2025-05-10 21:04:16 -04:00
237 changed files with 11282 additions and 5259 deletions

View File

@ -1,5 +1,5 @@
# ROM Properties Page Shell Extension
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5...3.10)
# CMP0048: Set VERSION variables based on the project version specified in PROJECT().
# Introduced in CMake 3.0.
@ -27,6 +27,12 @@ IF(POLICY CMP0151)
CMAKE_POLICY(SET CMP0151 NEW)
ENDIF(POLICY CMP0151)
# CMP0177: Normalize INSTALL() destination paths.
# Introduced in CMake 3.31.
IF(POLICY CMP0177)
CMAKE_POLICY(SET CMP0177 NEW)
ENDIF(POLICY CMP0177)
# Read the project version.
CONFIGURE_FILE(version.txt version.txt.tmp)
FILE(STRINGS version.txt RP_VERSION_FILE)
@ -89,13 +95,13 @@ SET(CMAKE_C_STANDARD_REQUIRED OFF)
SET(CMAKE_C_EXTENSIONS ON)
SET(CMAKE_CXX_STANDARD_REQUIRED OFF)
SET(CMAKE_CXX_EXTENSIONS ON)
IF(CMAKE_VERSION VERSION_GREATER 3.20) # >= 3.21
IF(CMAKE_VERSION VERSION_GREATER 3.20.99) # >= 3.21
SET(CMAKE_C_STANDARD 17)
SET(CMAKE_CXX_STANDARD 20)
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.11) # >= 3.12
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.11.99) # >= 3.12
SET(CMAKE_C_STANDARD 11)
SET(CMAKE_CXX_STANDARD 20)
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.7) # >= 3.8
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.7.99) # >= 3.8
SET(CMAKE_C_STANDARD 11)
SET(CMAKE_CXX_STANDARD 17)
ELSE()

43
NEWS.md
View File

@ -1,5 +1,48 @@
# Changes
## v2.6 (released 2025/??/??)
* New parsers:
* ICO: Windows icons and cursors. Supports most icons and cursors designed
for Windows 3.x and later (including Windows Vista PNG-format icons),
plus the old Windows 1.x format. Only the "best" version for each icon
is selected for thumbnailing. (Largest size and highest color depth.)
* Icon thumbnailing is not actually enabled on Windows and Linux systems
at the moment, since it may conflict with system icon handling.
It's mostly only usable for rpcli and for use as a subclass elsewhere.
* Partially fixes #170: Icon files: ICNS, ICO, EXE
* New parser features:
* Xbox360_STFS: Fix titles for some packages that were authored incorrectly
and have mojibake titles. Specifically, the titles were originally encoded
as UTF-8, but when building the package, they were handled as if they were
cp1252 when being converted to UTF-16BE.
* Fixes #450: X360 - Non-Latin Titles appearing as mojibake
* Reported by @Masamune3210.
* EXE: The application icon can now be extracted using rpcli.
* ISO: AUTORUN.INF is now parsed. This includes a tab showing the contents
of AUTORUN.INF, as well as the disc icon from a .ico or .exe/.dll file.
* Fixes #232: ISO: Parse autorun.inf
* ISO: Joliet file systems are now partially supported. This was added to
handle older Windows disc images that use a long filename for the icon,
and the disc is authored with Joliet for long filenames but an old version
of ISO-9660, resulting in 8.3 filenames in the ISO-9660 directories.
* Bug fixes:
* Windows: Work around a potential libpng crash when attempting to read
empty data as a PNG image. (Needs more debugging for a proper fix...)
* See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
* Reported by @Masamune3210.
* Qoi: R/B channels were incorrectly swapped when this was first added in v2.5.
* Affects: v2.5 - v2.5.1
* Fix an issue where an 'abgr' swizzle might fail on little-endian systems.
* Other changes:
* rpcli: Added more colorization for warning messages.
* rpcli: Refactored console handling into a separate library, libgsvt.
* IsoPartition: Implemented readdir(). Not currently used by anything, though.
* KDE (KF5, KF6): Improved image quality for RFT_LISTDATA fields with icons.
## v2.5.1 (released 2025/05/10)
* New parser features:

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
rom-properties (2.5.1-1ppa1~xenial2) xenial; urgency=medium
* Explicitly specify the Tracker API version.
NOTE: This must be updated for each Ubuntu version!
-- David Korth <gerbilsoft@gerbilsoft.com> Sat, 10 May 2025 16:52:48 -0400
rom-properties (2.5.1-1ppa1~xenial1) xenial; urgency=medium
* 2.5.1 release.

20
debian/control vendored
View File

@ -42,7 +42,7 @@ Vcs-Browser: https://github.com/GerbilSoft/rom-properties
Package: rom-properties-all
Architecture: any
Depends: ${misc:Depends}, libromdata6, rom-properties-kde4, rom-properties-kf5, rom-properties-xfce, rom-properties-gtk3, rom-properties-cli, rom-properties-tracker, rom-properties-utils, rom-properties-lang, rom-properties-thumbnailer-dbus
Depends: ${misc:Depends}, libromdata7, rom-properties-kde4, rom-properties-kf5, rom-properties-xfce, rom-properties-gtk3, rom-properties-cli, rom-properties-tracker, rom-properties-utils, rom-properties-lang, rom-properties-thumbnailer-dbus
Description: ROM Properties Page shell extension (meta package)
This shell extension provides thumbnailing and property page functionality
for ROM images, disc images, and save files for various game consoles,
@ -50,9 +50,9 @@ Description: ROM Properties Page shell extension (meta package)
.
This is a meta-package that installs all rom-properties packages.
Package: libromdata6
Package: libromdata7
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, rom-properties-data
Depends: ${shlibs:Depends}, ${misc:Depends}, rom-properties-data, liblz4-1, liblzo2-2
Description: ROM Properties Page shell extension (shared library)
This shell extension provides thumbnailing and property page functionality
for ROM images, disc images, and save files for various game consoles,
@ -63,7 +63,7 @@ Description: ROM Properties Page shell extension (shared library)
Package: rom-properties-kde4
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg
Recommends: rom-properties-lang
Description: ROM Properties Page shell extension (KDE4 UI frontend)
This shell extension provides thumbnailing and property page functionality
@ -74,7 +74,7 @@ Description: ROM Properties Page shell extension (KDE4 UI frontend)
Package: rom-properties-kio-servicemenus
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils
Conflicts: rom-properties-kf5 (<< 2.3)
Replaces: rom-properties-kf5 (<< 2.3)
Description: ROM Properties Page shell extension (KF5/KF6 service menus)
@ -86,7 +86,7 @@ Description: ROM Properties Page shell extension (KF5/KF6 service menus)
Package: rom-properties-kf5
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-kio-servicemenus
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-kio-servicemenus
Recommends: rom-properties-lang
Conflicts: rom-properties-kde5
Replaces: rom-properties-kde5
@ -99,7 +99,7 @@ Description: ROM Properties Page shell extension (KF5 UI frontend)
Package: rom-properties-xfce
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
Recommends: rom-properties-lang, rom-properties-tracker
Description: ROM Properties Page shell extension (GTK2 XFCE UI frontend)
This shell extension provides thumbnailing and property page functionality
@ -113,7 +113,7 @@ Description: ROM Properties Page shell extension (GTK2 XFCE UI frontend)
Package: rom-properties-gtk3
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
Recommends: rom-properties-lang, rom-properties-tracker
Conflicts: rom-properties-gnome, rom-properties-mate, rom-properties-cinnamon, rom-properties-gtk3-common
Replaces: rom-properties-gnome, rom-properties-mate, rom-properties-cinnamon, rom-properties-gtk3-common
@ -132,7 +132,7 @@ Description: ROM Properties Page shell extension (GTK3 UI frontend)
Package: rom-properties-cli
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7
Recommends: rom-properties-lang
Description: ROM Properties Page shell extension (command line version)
This shell extension provides thumbnailing and property page functionality
@ -143,7 +143,7 @@ Description: ROM Properties Page shell extension (command line version)
Package: rom-properties-tracker
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7
Description: ROM Properties Page shell extension (Tracker metadata extractor module)
This shell extension provides thumbnailing and property page functionality
for ROM images, disc images, and save files for various game consoles,

2
debian/rules vendored
View File

@ -24,7 +24,7 @@ CMAKE_OPTIONS := \
-DBUILD_GTK3=ON \
-DBUILD_GTK4=OFF \
-DBUILD_CLI=ON \
-DTRACKER_INSTALL_API_VERSION=AUTO \
-DTRACKER_INSTALL_API_VERSION=1 \
-DENABLE_PVRTC=ON \
-DENABLE_OPENMP=ON \
-DENABLE_LTO=OFF \

View File

@ -189,12 +189,14 @@ SET(USE_INTERNAL_MINIZIP TRUE PARENT_SCOPE)
SET(SKIP_INSTALL_HDR ON)
IF(WIN32)
SET(USE_INTERNAL_MINIZIP_DLL TRUE PARENT_SCOPE)
SET(SKIP_INSTALL_BINARIES ON)
SET(SKIP_INSTALL_LIBRARIES OFF)
SET(SKIP_INSTALL_ALL OFF)
SET(BUILD_SHARED_LIBS ON)
SET(BUILD_STATIC_LIBS OFF)
ELSE()
UNSET(USE_INTERNAL_MINIZIP_DLL PARENT_SCOPE)
SET(SKIP_INSTALL_BINARIES ON)
SET(SKIP_INSTALL_LIBRARIES ON)
SET(SKIP_INSTALL_ALL ON)
SET(BUILD_SHARED_LIBS OFF)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -73,7 +73,7 @@ extern "C" {
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBINTL_VERSION 0x001800
#define LIBINTL_VERSION 0x001900
/* rom-properties: LIBINTL_SHLIB_EXPORTED is already dllimport, so don't dllimport it again. */
extern LIBINTL_SHLIB_EXPORTED /*__declspec (dllimport)*/ int libintl_version;

View File

@ -5,6 +5,20 @@ EXPORTS
_nl_msg_cat_cntr DATA
bind_textdomain_codeset
bindtextdomain
c32isalnum
c32isalpha
c32isblank
c32iscntrl
c32isdigit
c32isgraph
c32islower
c32isprint
c32ispunct
c32isspace
c32isupper
c32isxdigit
c32tolower
c32width
dcgettext
dcngettext
dgettext
@ -45,10 +59,45 @@ EXPORTS
libintl_wbindtextdomain
libintl_wprintf
locale_charset
mb_copy
mb_width_aux
mbiterf_next
mbrtoc32
mbsnlen
ngettext
rpl_getcwd
rpl_iswalnum
rpl_iswalpha
rpl_iswblank
rpl_iswcntrl
rpl_iswdigit
rpl_iswgraph
rpl_iswlower
rpl_iswprint
rpl_iswpunct
rpl_iswspace
rpl_iswupper
rpl_iswxdigit
rpl_localeconv
rpl_pthread_once
rpl_towlower
rpl_towupper
setlocale_messages
setlocale_messages_null
textdomain
uc_is_alnum
uc_is_alpha
uc_is_blank
uc_is_cntrl
uc_is_digit
uc_is_graph
uc_is_lower
uc_is_print
uc_is_punct
uc_is_space
uc_is_upper
uc_is_xdigit
uc_tolower
uc_width
wcwidth
wgetcwd

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,6 +5,20 @@ EXPORTS
_nl_msg_cat_cntr DATA
bind_textdomain_codeset
bindtextdomain
c32isalnum
c32isalpha
c32isblank
c32iscntrl
c32isdigit
c32isgraph
c32islower
c32isprint
c32ispunct
c32isspace
c32isupper
c32isxdigit
c32tolower
c32width
dcgettext
dcngettext
dgettext
@ -45,10 +59,45 @@ EXPORTS
libintl_wbindtextdomain
libintl_wprintf
locale_charset
mb_copy
mb_width_aux
mbiterf_next
mbrtoc32
mbsnlen
ngettext
rpl_getcwd
rpl_iswalnum
rpl_iswalpha
rpl_iswblank
rpl_iswcntrl
rpl_iswdigit
rpl_iswgraph
rpl_iswlower
rpl_iswprint
rpl_iswpunct
rpl_iswspace
rpl_iswupper
rpl_iswxdigit
rpl_localeconv
rpl_pthread_once
rpl_towlower
rpl_towupper
setlocale_messages
setlocale_messages_null
textdomain
uc_is_alnum
uc_is_alpha
uc_is_blank
uc_is_cntrl
uc_is_digit
uc_is_graph
uc_is_lower
uc_is_print
uc_is_punct
uc_is_space
uc_is_upper
uc_is_xdigit
uc_tolower
uc_width
wcwidth
wgetcwd

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
# Note: CMake support is community-based. The maintainers do not use CMake
# internally.
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5...3.10)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)

View File

@ -36,7 +36,7 @@ endif()
# as ${gmock_SOURCE_DIR} and to the root binary directory as
# ${gmock_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5...3.10)
cmake_policy(SET CMP0048 NEW)
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)

View File

@ -46,7 +46,7 @@ endif()
# Project version:
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5...3.10)
cmake_policy(SET CMP0048 NEW)
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)

View File

@ -1,5 +1,5 @@
libpng 1.6.48 - April 30, 2025
==============================
libpng 1.6.49 - June 12, 2025
=============================
This is a public release of libpng, intended for use in production code.
@ -9,13 +9,13 @@ Files available for download
Source files with LF line endings (for Unix/Linux):
* libpng-1.6.48.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.48.tar.gz (deflate-compressed)
* libpng-1.6.49.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.49.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
* lpng1648.7z (LZMA-compressed, recommended)
* lpng1648.zip (deflate-compressed)
* lpng1649.7z (LZMA-compressed, recommended)
* lpng1649.zip (deflate-compressed)
Other information:
@ -25,17 +25,13 @@ Other information:
* TRADEMARK.md
Changes from version 1.6.47 to version 1.6.48
Changes from version 1.6.48 to version 1.6.49
---------------------------------------------
* Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
(Reported by Mohit Bakshi; fixed by John Bowler)
* Added #error directives to discourage the inclusion of private
libpng implementation header files in PNG-supporting applications.
* Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
alternative to `DFA_XTRA`.
* Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!
* Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
* Added various fixes and improvements to the build scripts and to
the sample code.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.

View File

@ -20,6 +20,7 @@ Authors, for copyright and licensing purposes.
* Lucas Chollet
* Magnus Holmgren
* Mandar Sahastrabuddhe
* Manfred Schlaegl
* Mans Rullgard
* Matt Sarett
* Mike Klein
@ -40,8 +41,9 @@ Authors, for copyright and licensing purposes.
- Zixu Wang (王子旭)
* Arm Holdings
- Richard Townsend
* Google Inc.
* Google LLC
- Dan Field
- Dragoș Tiselice
- Leon Scroggins III
- Matt Sarett
- Mike Klein
@ -51,6 +53,8 @@ Authors, for copyright and licensing purposes.
- GuXiWei (顾希伟)
- JinBo (金波)
- ZhangLixia (张利霞)
* Samsung Group
- Filip Wasil
The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have

View File

@ -6261,6 +6261,12 @@ Version 1.6.48 [April 30, 2025]
Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!
Version 1.6.49 [June 12, 2025]
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
Added various fixes and improvements to the build scripts and to
the sample code.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@ -19,7 +19,7 @@
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
set(PNGLIB_REVISION 48)
set(PNGLIB_REVISION 49)
set(PNGLIB_SUBREVISION 0)
#set(PNGLIB_SUBREVISION "git")
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
@ -116,8 +116,7 @@ if(NOT PNG_EXECUTABLES)
endif()
endif()
# Allow the users to configure various compilation options.
option(PNG_DEBUG "Enable debug output" OFF)
# Allow the users to switch on/off the use of hardware (SIMD) optimized code.
option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON)
ENDIF(0) # rom-properties
@ -159,6 +158,7 @@ else()
find_package(ZLIB REQUIRED)
endif()
# Find the math library (where available).
if(UNIX
AND NOT (APPLE OR BEOS OR HAIKU)
AND NOT EMSCRIPTEN)
@ -172,6 +172,13 @@ else()
# libm is not available or not needed.
endif()
# Silence function deprecation warnings on the Windows compilers that might
# use the MSVC Runtime library headers.
if(WIN32 AND (CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel|Clang"))
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()
if(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for ARM.
@ -360,6 +367,35 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
endif()
endif()
# Set definitions and sources for RISC-V.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)")
include(CheckCCompilerFlag)
set(PNG_RISCV_RVV_POSSIBLE_VALUES check on off)
set(PNG_RISCV_RVV "off"
CACHE STRING "Enable RISC-V Vector optimizations: check|on|off; off is default")
set_property(CACHE PNG_RISCV_RVV
PROPERTY STRINGS ${PNG_RISCV_RVV_POSSIBLE_VALUES})
list(FIND PNG_RISCV_RVV_POSSIBLE_VALUES ${PNG_RISCV_RVV} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]")
elseif(NOT PNG_RISCV_RVV STREQUAL "off")
check_c_compiler_flag("-march=rv64gv1p0" COMPILER_SUPPORTS_RVV)
if(NOT COMPILER_SUPPORTS_RVV)
message(FATAL_ERROR "Compiler does not support -march=rv64gv1p0 option")
endif()
set(libpng_riscv_sources
riscv/filter_rvv_intrinsics.c
riscv/riscv_init.c)
if(PNG_RISCV_RVV STREQUAL "on")
add_definitions(-DPNG_RISCV_RVV_OPT=2)
elseif(PNG_RISCV_RVV STREQUAL "check")
add_definitions(-DPNG_RISCV_RVV_CHECK_SUPPORTED)
endif()
else()
add_definitions(-DPNG_RISCV_RVV_OPT=0)
endif()
endif()
else(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for ARM.
@ -387,6 +423,11 @@ else(PNG_HARDWARE_OPTIMIZATIONS)
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
endif()
# Set definitions and sources for RISC-V.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)")
add_definitions(-DPNG_RISCV_RVV_OPT=0)
endif()
endif(PNG_HARDWARE_OPTIMIZATIONS)
option(ld-version-script "Enable linker version script" ON)
@ -442,13 +483,13 @@ if(PNG_LIBCONF_HEADER STREQUAL "")
endif()
# Include the internal module PNGCheckLibconf.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake)
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake")
if(NOT PNG_LIBCONF_HEADER STREQUAL "")
# Configure libpng with the user-defined pnglibconf.h file.
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER}")
configure_file("${PNG_LIBCONF_HEADER}"
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
@ONLY)
add_custom_target(png_genfiles)
elseif(NOT AWK)
@ -456,47 +497,43 @@ elseif(NOT AWK)
# Configure libpng with pnglibconf.h.prebuilt.
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
@ONLY)
add_custom_target(png_genfiles)
else()
png_check_libconf(DFA_XTRA "${DFA_XTRA}")
# Include the internal module PNGGenConfig.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake)
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake")
# Work around a limitation of various Windows AWK programs that are
# unable to process CRLF-terminated AWK scripts.
# Copy these AWK scripts to a temporary location, converting their
# line endings from Windows (CRLF) to Unix (LF) at the destination.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk
${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
@ONLY
NEWLINE_STYLE LF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk
${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
@ONLY
NEWLINE_STYLE LF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/dfn.awk
${CMAKE_CURRENT_BINARY_DIR}/scripts/dfn.awk
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/dfn.awk"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/dfn.awk"
@ONLY
NEWLINE_STYLE LF)
# Generate scripts/pnglibconf.h
generate_source(OUTPUT "scripts/pnglibconf.c"
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
add_custom_target(png_scripts_pnglibconf_c
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c")
# Generate pnglibconf.c
generate_source(OUTPUT "pnglibconf.c"
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
add_custom_target(pnglibconf_c
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c")
if(PNG_PREFIX)
set(PNGLIBCONF_H_EXTRA_DEPENDS
@ -507,85 +544,53 @@ else()
endif()
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
DEPENDS pnglibconf_c)
add_custom_target(pnglibconf_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
# Generate pnglibconf.h
generate_source(OUTPUT "pnglibconf.h"
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out
${PNGLIBCONF_H_EXTRA_DEPENDS})
add_custom_target(pnglibconf_h
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_intprefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/prefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out)
add_custom_target(png_scripts_prefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
# Generate pngprefix.h
generate_source(OUTPUT "pngprefix.h"
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
DEPENDS ${PNGPREFIX_H_EXTRA_DEPENDS})
add_custom_target(pngprefix_h
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_sym_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
add_custom_target(png_scripts_symbols_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_vers_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
DEPENDS png_scripts_symbols_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
add_custom_target(png_scripts_symbols_chk
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
DEPENDS png_scripts_sym_out)
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
DEPENDS png_scripts_vers_out)
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
add_custom_target(png_genvers
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
add_custom_target(png_gensym
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
add_custom_target(png_genprebuilt
COMMAND "${CMAKE_COMMAND}"
@ -596,31 +601,18 @@ else()
# A single target handles generation of all generated files.
add_custom_target(png_genfiles
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
png_gensym
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
png_genvers
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
pngprefix_h
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
png_scripts_intprefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
png_scripts_pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
png_scripts_prefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
png_scripts_sym_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
png_scripts_symbols_chk
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
png_scripts_symbols_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
png_scripts_vers_out)
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
endif()
# List the source code files.
@ -661,7 +653,9 @@ set(libpng_sources
${libpng_mips_sources}
${libpng_powerpc_sources}
${libpng_loongarch_sources}
${libpng_riscv_sources}
)
set(pngtest_sources
pngtest.c
)
@ -684,10 +678,13 @@ set(png_fix_itxt_sources
contrib/tools/png-fix-itxt.c
)
if(MSVC OR (WIN32 AND (CMAKE_C_COMPILER_ID MATCHES "Clang")))
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()
# rom-properties: FIXME: "/guard:cf" causes png_longjmp() to crash
# in MSVC 2022 Release builds on Windows 10.
IF(MSVC)
FOREACH(_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS)
STRING(REPLACE "/guard:cf" "" ${_var} "${${${_var}}}")
ENDFOREACH(_var)
ENDIF(MSVC)
# rom-properties: Add -DPNG_DEBUG=0 in debug builds.
IF(0)
@ -767,12 +764,12 @@ if(PNG_SHARED)
)
endif()
target_include_directories(png_shared
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_include_directories(png_shared
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_include_directories(png_shared
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_shared
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
@ -791,12 +788,12 @@ if(PNG_STATIC)
PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_include_directories(png_static
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_static
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
@ -827,12 +824,12 @@ if(PNG_FRAMEWORK)
set_target_properties(png_framework
PROPERTIES DEFINE_SYMBOL "")
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_include_directories(png_framework
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_framework
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
@ -848,7 +845,7 @@ if(PNG_TESTS AND PNG_SHARED)
enable_testing()
# Include the internal module PNGTest.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGTest.cmake)
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGTest.cmake")
# Find test PNG files by globbing, but sort lists to ensure
# consistency between different filesystems.
@ -1059,12 +1056,14 @@ function(create_symlink DEST_FILE)
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
execute_process(COMMAND "${CMAKE_COMMAND}"
-E copy_if_different
${_SYM_FILE} ${DEST_FILE}
"${_SYM_FILE}"
"${DEST_FILE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
else()
execute_process(COMMAND "${CMAKE_COMMAND}"
-E create_symlink
${_SYM_FILE} ${DEST_FILE}
"${_SYM_FILE}"
"${DEST_FILE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
endif()
@ -1078,28 +1077,28 @@ function(create_symlink DEST_FILE)
POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-E copy_if_different
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>"
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE}")
else()
add_custom_command(TARGET ${_SYM_TARGET}
POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-E create_symlink
$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
"$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>"
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE}")
endif()
endif()
endfunction()
# Create source generation scripts.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake"
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake"
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake"
@ONLY)
# libpng is a library so default to 'lib'
@ -1112,17 +1111,17 @@ endif()
# Only do this on Windows for Cygwin - the files don't make much sense
# outside of a UNIX look-alike.
if(NOT WIN32 OR CYGWIN OR MINGW)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc"
@ONLY)
create_symlink(libpng.pc FILE libpng${PNGLIB_ABI_VERSION}.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in"
"${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
@ONLY)
create_symlink(libpng-config FILE libpng${PNGLIB_ABI_VERSION}-config)
endif()
@ -1138,10 +1137,10 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# - Disabled the export rule
install(TARGETS ${PNG_LIBRARY_TARGETS}
#EXPORT libpng
RUNTIME DESTINATION ${INSTALL_BIN_DIR}
#LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
#ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${INSTALL_LIB_DIR})
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
#LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
#ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
FRAMEWORK DESTINATION "${INSTALL_LIB_DIR}")
IF(INSTALL_DEBUG AND PNG_SHARED)
# FIXME: Generator expression $<TARGET_PROPERTY:${_target},PDB> didn't work with CPack-3.6.1.
@ -1166,16 +1165,16 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
if(NOT WIN32 OR CYGWIN OR MINGW)
create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png_shared)
install(FILES $<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES "$<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()
endif()
if(PNG_STATIC)
if(NOT WIN32 OR CYGWIN OR MINGW)
create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES "$<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()
endif()
ENDIF(0)
@ -1183,40 +1182,40 @@ endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES ${libpng_public_hdrs}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(FILES ${libpng_public_hdrs}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION})
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}")
endif()
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL)
if(NOT WIN32 OR CYGWIN OR MINGW)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config"
DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()
if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${PNG_BIN_TARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
# Install the man pages.
install(FILES libpng.3 libpngpf.3
DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
install(FILES png.5
DESTINATION ${CMAKE_INSTALL_MANDIR}/man5)
DESTINATION "${CMAKE_INSTALL_MANDIR}/man5")
# Install the pkg-config files.
if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config"
DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
endif()
@ -1225,7 +1224,7 @@ endif()
IF(0)
if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
install(EXPORT libpng
DESTINATION ${CMAKE_INSTALL_LIBDIR}/libpng
DESTINATION "${CMAKE_INSTALL_LIBDIR}/libpng"
FILE libpng${PNGLIB_ABI_VERSION}.cmake)
endif()
ENDIF(0) # rom-properties
@ -1234,10 +1233,10 @@ ENDIF(0) # rom-properties
if(NOT SKIP_INSTALL_CONFIG_FILE AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${PNG_LIBRARY_TARGETS}
EXPORT PNGTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(PNGConfigVersion.cmake
@ -1247,11 +1246,11 @@ if(NOT SKIP_INSTALL_CONFIG_FILE AND NOT SKIP_INSTALL_ALL)
install(EXPORT PNGTargets
FILE PNGTargets.cmake
NAMESPACE PNG::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PNG)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/PNGConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PNG)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/PNGConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG")
endif()
# TODO: Create MSVC import lib for MinGW-compiled shared lib.

10
extlib/libpng/INSTALL vendored
View File

@ -136,7 +136,7 @@ Your directory structure should look like this:
depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
contrib
arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminus, pngsuite, tools, visupng
pngminus, pngsuite, tools, visupng, riscv-rvv
projects
owatcom, visualc71, vstudio
scripts
@ -289,6 +289,7 @@ such as one of
--enable-mips-msa=yes
--enable-intel-sse=yes
--enable-powerpc-vsx=yes
--enable-riscv-rvv=yes
or enable them all at once with
@ -301,6 +302,7 @@ or more of
CPPFLAGS += "-DPNG_MIPS_MSA"
CPPFLAGS += "-DPNG_INTEL_SSE"
CPPFLAGS += "-DPNG_POWERPC_VSX"
CPPFLAGS += "-DPNG_RISCV_RVV"
See for example scripts/makefile.linux-opt
@ -317,13 +319,15 @@ to disable a particular one,
or via compiler-command options such as
CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0"
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0,
-DPNG_RISCV_RVV_OPT=0"
If you are using cmake, hardware optimizations are "on"
by default. To disable them, use
cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no \
-DPNG_RISCV_RVV=no
or disable them all at once with

View File

@ -1,4 +1,4 @@
README for libpng version 1.6.48
README for libpng version 1.6.49
================================
See the note about version numbers near the top of `png.h`.
@ -147,6 +147,7 @@ Files included in this distribution
loongarch/ => Optimized code for LoongArch LSX
mips/ => Optimized code for MIPS MSA and MIPS MMI
powerpc/ => Optimized code for PowerPC VSX
riscv/ => Optimized code for the RISC-V platform
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
@ -162,6 +163,7 @@ Files included in this distribution
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
riscv-rvv/ => Optimized code for the RISC-V Vector platform
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images

View File

@ -108,6 +108,15 @@
/* Enable POWERPC VSX optimizations */
#undef PNG_POWERPC_VSX_OPT
/* Turn on RISC-V Vector optimizations at run-time */
#undef PNG_RISCV_RVV_API_SUPPORTED
/* Check for RISC-V Vector support at run-time */
#undef PNG_RISCV_RVV_CHECK_SUPPORTED
/* Enable RISCV RVV optimizations */
#undef PNG_RISCV_RVV_OPT
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */

85
extlib/libpng/contrib/riscv-rvv/README vendored Normal file
View File

@ -0,0 +1,85 @@
OPERATING SYSTEM SPECIFIC RISC-V RVV DETECTION
----------------------------------------------
Detection of the ability to execute RISC-V Vector on a RISC-V processor
requires operating system support. (The information is not available in user
mode.)
HOW TO USE THIS
---------------
This directory contains C code fragments that can be included in
riscv/riscv_init.c by setting the macro PNG_RISCV_RVV_FILE to the file name
in "" or <> at build time. This setting is not recorded in pnglibconf.h and
can be changed simply by rebuilding riscv/riscv_init.o with the required macro
definition.
For any of this code to be used the RISC-V Vector code must be enabled and run
time checks must be supported. I.e.:
#if PNG_RISCV_RVV_OPT > 0
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED
This is done in a 'configure' build by passing configure the argument:
--enable-riscv-rvv=check
Apart from the basic Linux implementation in contrib/riscv-rvv/linux.c this
code is unsupported. That means that it is not even compiled on a regular
basis and may be broken in any given minor release.
FILE FORMAT
-----------
Each file documents its testing status as of the last time it was tested (which
may have been a long time ago):
STATUS: one of:
SUPPORTED: This indicates that the file is included in the regularly
performed test builds and bugs are fixed when discovered.
COMPILED: This indicates that the code did compile at least once. See the
more detailed description for the extent to which the result was
successful.
TESTED: This means the code was fully compiled into the libpng test programs
and these were run at least once.
BUG REPORTS: an email address to which to send reports of problems
The file is a fragment of C code. It should not define any 'extern' symbols;
everything should be static. It must define the function:
static int png_have_rvv(png_structp png_ptr);
That function must return 1 if RISC-V Vector instructions are supported, 0 if
not. It must not execute png_error unless it detects a bug. A png_error will
prevent the reading of the PNG and in the future, writing too.
BUG REPORTS
-----------
If you mail a bug report for any file that is not SUPPORTED there may only be
limited response. Consider fixing it and sending a patch to fix the problem -
this is more likely to result in action.
CONTRIBUTIONS
-------------
You may send contributions of new implementations to
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
possible. Obviously OS dependencies are to be expected. If you submit code you
must have the authors permission and it must have a license that is acceptable
to the current maintainer; in particular that license must permit modification
and redistribution.
Please try to make the contribution a single file and give the file a clear and
unambiguous name that identifies the target OS. If multiple files really are
required put them all in a sub-directory.
You must also be prepared to handle bug reports from users of the code, either
by joining the png-mng-implement mailing list or by providing an email for the
"BUG REPORTS" entry or both. Please make sure that the header of the file
contains the STATUS and BUG REPORTS fields as above.
Please list the OS requirements as precisely as possible. Ideally you should
also list the environment in which the code has been tested and certainly list
any environments where you suspect it might not work.

36
extlib/libpng/contrib/riscv-rvv/linux.c vendored Normal file
View File

@ -0,0 +1,36 @@
/* contrib/riscv-rvv/linux.c
*
* Copyright (c) 2023 Google LLC
* Written by Dragoș Tiselice <dtiselice@google.com>, May 2023.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* SEE contrib/riscv-rvv/README before reporting bugs
*
* STATUS: SUPPORTED
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_rvv implemented for Linux by looking for COMPAT_HWCAP_ISA_V
* via hardware capabilites API.
*
* This code is strict ANSI-C and is probably moderately portable; it does
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
*/
#if defined(__linux__)
#include <asm/hwcap.h>
#include <sys/auxv.h>
#endif
static int
png_have_rvv(png_structp png_ptr) {
#if defined(__linux__)
return getauxval (AT_HWCAP) & COMPAT_HWCAP_ISA_V ? 1 : 0;
#else
#pragma message( \
"warning: RISC-V Vector not supported for this platform")
return 0;
#endif
}

View File

@ -9,7 +9,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
libpng version 1.6.36, December 2018, through 1.6.49 - June 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "April 30, 2025"
.TH LIBPNG 3 "June 12, 2025"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.49
.SH SYNOPSIS
\fB#include <png.h>\fP
@ -528,7 +528,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
libpng version 1.6.36, December 2018, through 1.6.49 - June 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "April 30, 2025"
.TH LIBPNGPF 3 "June 12, 2025"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.49
.SH SYNOPSIS
\fB#include "pngpriv.h"\fP

6
extlib/libpng/png.5 vendored
View File

@ -1,4 +1,4 @@
.TH PNG 5 "April 30, 2025"
.TH PNG 5 "June 12, 2025"
.SH NAME
png \- Portable Network Graphics (PNG) format
@ -20,10 +20,10 @@ matching on heterogeneous platforms.
.SH "SEE ALSO"
.BR "libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP
PNG Specification (Third Edition) Candidate Recommendation, March 2025:
PNG Specification (Third Edition) Proposed Recommendation, May 2025:
.IP
.br
https://www.w3.org/TR/2025/CR-png-3-20250313/
https://www.w3.org/TR/2025/PR-png-3-20250515/
.LP
PNG Specification (Second Edition), November 2003:
.IP

4
extlib/libpng/png.c vendored
View File

@ -13,7 +13,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
typedef png_libpng_version_1_6_49 Your_png_h_is_not_version_1_6_49;
/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
@ -815,7 +815,7 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.48" PNG_STRING_NEWLINE \
"libpng version 1.6.49" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \

67
extlib/libpng/png.h vendored
View File

@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.48
* libpng version 1.6.49
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@ -14,7 +14,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
* libpng versions 1.6.36, December 2018, through 1.6.48, April 2025:
* libpng versions 1.6.36, December 2018, through 1.6.49, June 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@ -238,7 +238,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
* 1.6.48 16 10648 16.so.16.48[.0]
* 1.6.49 16 10649 16.so.16.49[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@ -274,7 +274,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.48"
#define PNG_LIBPNG_VER_STRING "1.6.49"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@ -285,7 +285,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 48
#define PNG_LIBPNG_VER_RELEASE 49
/* This should be zero for a public release, or non-zero for a
* development version.
@ -316,7 +316,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10648 /* 1.6.48 */
#define PNG_LIBPNG_VER 10649 /* 1.6.49 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@ -441,7 +441,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_6_48;
typedef char* png_libpng_version_1_6_49;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@ -3322,26 +3322,45 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
* selected at run time.
*/
#ifdef PNG_SET_OPTION_SUPPORTED
/* HARDWARE: ARM Neon SIMD instructions supported */
#ifdef PNG_ARM_NEON_API_SUPPORTED
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */
#endif
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
#ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
#endif
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
* supported */
#endif
#ifdef PNG_MIPS_MMI_API_SUPPORTED
# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
# define PNG_ARM_NEON 0
#endif
#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
/* SOFTWARE: Force maximum window */
#define PNG_MAXIMUM_INFLATE_WINDOW 2
/* SOFTWARE: Check ICC profile for sRGB */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4
/* HARDWARE: MIPS MSA SIMD instructions supported */
#ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6
#endif
/* SOFTWARE: Disable Adler32 check on IDAT */
#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
# define PNG_IGNORE_ADLER32 8
#endif
/* HARDWARE: PowerPC VSX SIMD instructions supported */
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
# define PNG_POWERPC_VSX 10
#endif
/* HARDWARE: MIPS MMI SIMD instructions supported */
#ifdef PNG_MIPS_MMI_API_SUPPORTED
# define PNG_MIPS_MMI 12
#endif
/* HARDWARE: RISC-V RVV SIMD instructions supported */
#ifdef PNG_RISCV_RVV_API_SUPPORTED
# define PNG_RISCV_RVV 14
#endif
/* Next option - numbers must be even */
#define PNG_OPTION_NEXT 16
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine-configurable file for libpng
*
* libpng version 1.6.48
* libpng version 1.6.49
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson

View File

@ -143,6 +143,24 @@
# endif
#endif
#ifndef PNG_RISCV_RVV_OPT
/* RISCV_RVV optimizations are being controlled by the compiler settings,
* typically the target compiler will define __riscv but the rvv extension
* availability has to be explicitly stated. This is why if no
* PNG_RISCV_RVV_OPT was defined then a runtime check will be executed.
*
* To enable RISCV_RVV optimizations unconditionally, and compile the
* associated code, pass --enable-riscv-rvv=yes or --enable-riscv-rvv=on
* to configure or put -DPNG_RISCV_RVV_OPT=2 in CPPFLAGS.
*/
# if defined(__riscv) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_RISCV_RVV_OPT 1
# else
# define PNG_RISCV_RVV_OPT 0
# endif
#endif
#if PNG_ARM_NEON_OPT > 0
/* NEON optimizations are to be at least considered by libpng, so enable the
* callbacks to do this.
@ -260,6 +278,16 @@
# define PNG_LOONGARCH_LSX_IMPLEMENTATION 0
#endif
#if PNG_RISCV_RVV_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_rvv
# ifndef PNG_RISCV_RVV_IMPLEMENTATION
/* Use the intrinsics code by default. */
# define PNG_RISCV_RVV_IMPLEMENTATION 1
# endif
#else
# define PNG_RISCV_RVV_IMPLEMENTATION 0
#endif
/* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If
* so PNG_BUILD_DLL must be set.
@ -1505,6 +1533,23 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_lsx,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_RISCV_RVV_OPT > 0
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_rvv,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
/* Choose the best filter to use and filter the row data */
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
png_row_infop row_info),PNG_EMPTY);
@ -2158,6 +2203,11 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_lsx,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
# if PNG_RISCV_RVV_OPT > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_rvv,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
png_const_charp key, png_bytep new_key), PNG_EMPTY);

View File

@ -889,7 +889,8 @@ png_read_destroy(png_structrp png_ptr)
#endif
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
defined(PNG_ARM_NEON_IMPLEMENTATION)
(defined(PNG_ARM_NEON_IMPLEMENTATION) || \
defined(PNG_RISCV_RVV_IMPLEMENTATION))
png_free(png_ptr, png_ptr->riffled_palette);
png_ptr->riffled_palette = NULL;
#endif

View File

@ -29,6 +29,12 @@
# endif
#endif
#ifdef PNG_RISCV_RVV_IMPLEMENTATION
# if PNG_RISCV_RVV_IMPLEMENTATION == 1
# define PNG_RISCV_RVV_INTRINSICS_AVAILABLE
# endif
#endif
#ifdef PNG_READ_SUPPORTED
/* Set the action on getting a CRC error for an ancillary or critical chunk. */

View File

@ -4434,7 +4434,6 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
png_error(png_ptr, "Not enough image data");
}
#endif /* PNG_READ_APNG_SUPPORTED */
avail_in = png_ptr->IDAT_read_size;
if (avail_in > png_chunk_max(png_ptr))

View File

@ -375,7 +375,8 @@ struct png_struct_def
/* New member added in libpng-1.6.36 */
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
defined(PNG_ARM_NEON_IMPLEMENTATION)
(defined(PNG_ARM_NEON_IMPLEMENTATION) || \
defined(PNG_RISCV_RVV_IMPLEMENTATION))
png_bytep riffled_palette; /* buffer for accelerated palette expansion */
#endif

View File

@ -50,7 +50,7 @@
#define STDERR stdout
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
typedef png_libpng_version_1_6_49 Your_png_h_is_not_version_1_6_49;
/* Ensure that all version numbers in png.h are consistent with one another. */
#if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \

8
extlib/libpng/riscv/.editorconfig vendored Normal file
View File

@ -0,0 +1,8 @@
# https://editorconfig.org
root = false
# FIXME
[*.[ch]]
max_doc_length = unset
max_line_length = unset

View File

@ -0,0 +1,368 @@
/* filter_rvv_intrinsics.c - RISC-V Vector optimized filter functions
*
* Copyright (c) 2023 Google LLC
* Written by Manfred SCHLAEGL, 2022
* Dragoș Tiselice <dtiselice@google.com>, May 2023.
* Filip Wasil <f.wasil@samsung.com>, March 2025.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_RISCV_RVV_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
#include <riscv_vector.h>
void
png_read_filter_row_up_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
for (size_t vl; len > 0; len -= vl, row += vl, prev_row += vl)
{
vl = __riscv_vsetvl_e8m8(len);
vuint8m8_t prev_vals = __riscv_vle8_v_u8m8(prev_row, vl);
vuint8m8_t row_vals = __riscv_vle8_v_u8m8(row, vl);
row_vals = __riscv_vadd_vv_u8m8(row_vals, prev_vals, vl);
__riscv_vse8_v_u8m8(row, row_vals, vl);
}
}
static inline void
png_read_filter_row_sub_rvv(size_t len, size_t bpp, unsigned char* row)
{
png_bytep rp_end = row + len;
/*
* row: | a | x |
*
* a = a + x
*
* a .. [v0](e8)
* x .. [v8](e8)
*/
asm volatile ("vsetvli zero, %0, e8, m1" : : "r" (bpp));
/* a = *row */
asm volatile ("vle8.v v0, (%0)" : : "r" (row));
row += bpp;
while (row < rp_end)
{
/* x = *row */
asm volatile ("vle8.v v8, (%0)" : : "r" (row));
/* a = a + x */
asm volatile ("vadd.vv v0, v0, v8");
/* *row = a */
asm volatile ("vse8.v v0, (%0)" : : "r" (row));
row += bpp;
}
}
void
png_read_filter_row_sub3_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_sub_rvv(len, 3, row);
PNG_UNUSED(prev_row)
}
void
png_read_filter_row_sub4_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_sub_rvv(len, 4, row);
PNG_UNUSED(prev_row)
}
static inline void
png_read_filter_row_avg_rvv(size_t len, size_t bpp, unsigned char* row,
const unsigned char* prev_row)
{
png_bytep rp_end = row + len;
/*
* row: | a | x |
* prev_row: | | b |
*
* a .. [v2](e8)
* b .. [v4](e8)
* x .. [v8](e8)
* tmp .. [v12-v13](e16)
*/
/* first pixel */
asm volatile ("vsetvli zero, %0, e8, m1" : : "r" (bpp));
/* b = *prev_row */
asm volatile ("vle8.v v4, (%0)" : : "r" (prev_row));
prev_row += bpp;
/* x = *row */
asm volatile ("vle8.v v8, (%0)" : : "r" (row));
/* b = b / 2 */
asm volatile ("vsrl.vi v4, v4, 1");
/* a = x + b */
asm volatile ("vadd.vv v2, v4, v8");
/* *row = a */
asm volatile ("vse8.v v2, (%0)" : : "r" (row));
row += bpp;
/* remaining pixels */
while (row < rp_end)
{
/* b = *prev_row */
asm volatile ("vle8.v v4, (%0)" : : "r" (prev_row));
prev_row += bpp;
/* x = *row */
asm volatile ("vle8.v v8, (%0)" : : "r" (row));
/* tmp = a + b */
asm volatile ("vwaddu.vv v12, v2, v4"); /* add with widening */
/* a = tmp/2 */
asm volatile ("vnsrl.wi v2, v12, 1"); /* divide/shift with narrowing */
/* a += x */
asm volatile ("vadd.vv v2, v2, v8");
/* *row = a */
asm volatile ("vse8.v v2, (%0)" : : "r" (row));
row += bpp;
}
}
void
png_read_filter_row_avg3_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_avg_rvv(len, 3, row, prev_row);
PNG_UNUSED(prev_row)
}
void
png_read_filter_row_avg4_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_avg_rvv(len, 4, row, prev_row);
PNG_UNUSED(prev_row)
}
#define MIN_CHUNK_LEN 256
#define MAX_CHUNK_LEN 2048
static inline vuint8m1_t
prefix_sum(vuint8m1_t chunk, unsigned char* carry, size_t vl,
size_t max_chunk_len)
{
size_t r;
for (r = 1; r < MIN_CHUNK_LEN; r <<= 1)
{
vbool8_t shift_mask = __riscv_vmsgeu_vx_u8m1_b8(__riscv_vid_v_u8m1(vl), r, vl);
chunk = __riscv_vadd_vv_u8m1_mu(shift_mask, chunk, chunk, __riscv_vslideup_vx_u8m1(__riscv_vundefined_u8m1(), chunk, r, vl), vl);
}
for (r = MIN_CHUNK_LEN; r < MAX_CHUNK_LEN && r < max_chunk_len; r <<= 1)
{
vbool8_t shift_mask = __riscv_vmsgeu_vx_u8m1_b8(__riscv_vid_v_u8m1(vl), r, vl);
chunk = __riscv_vadd_vv_u8m1_mu(shift_mask, chunk, chunk, __riscv_vslideup_vx_u8m1(__riscv_vundefined_u8m1(), chunk, r, vl), vl);
}
chunk = __riscv_vadd_vx_u8m1(chunk, *carry, vl);
*carry = __riscv_vmv_x_s_u8m1_u8(__riscv_vslidedown_vx_u8m1(chunk, vl - 1, vl));
return chunk;
}
static inline vint16m1_t
abs_diff(vuint16m1_t a, vuint16m1_t b, size_t vl)
{
vint16m1_t diff = __riscv_vreinterpret_v_u16m1_i16m1(__riscv_vsub_vv_u16m1(a, b, vl));
vint16m1_t neg = __riscv_vneg_v_i16m1(diff, vl);
return __riscv_vmax_vv_i16m1(diff, neg, vl);
}
static inline vint16m1_t
abs_sum(vint16m1_t a, vint16m1_t b, size_t vl)
{
vint16m1_t sum = __riscv_vadd_vv_i16m1(a, b, vl);
vint16m1_t neg = __riscv_vneg_v_i16m1(sum, vl);
return __riscv_vmax_vv_i16m1(sum, neg, vl);
}
static inline void
png_read_filter_row_paeth_rvv(size_t len, size_t bpp, unsigned char* row,
const unsigned char* prev)
{
png_bytep rp_end = row + len;
/*
* row: | a | x |
* prev: | c | b |
*
* mask .. [v0]
* a .. [v2](e8)
* b .. [v4](e8)
* c .. [v6](e8)
* x .. [v8](e8)
* p .. [v12-v13](e16)
* pa .. [v16-v17](e16)
* pb .. [v20-v21](e16)
* pc .. [v24-v25](e16)
* tmpmask ..[v31]
*/
/* first pixel */
asm volatile ("vsetvli zero, %0, e8, m1" : : "r" (bpp));
/* a = *row + *prev_row */
asm volatile ("vle8.v v2, (%0)" : : "r" (row));
asm volatile ("vle8.v v6, (%0)" : : "r" (prev));
prev += bpp;
asm volatile ("vadd.vv v2, v2, v6");
/* *row = a */
asm volatile ("vse8.v v2, (%0)" : : "r" (row));
row += bpp;
/* remaining pixels */
while (row < rp_end)
{
/* b = *prev_row */
asm volatile ("vle8.v v4, (%0)" : : "r" (prev));
prev += bpp;
/* x = *row */
asm volatile ("vle8.v v8, (%0)" : : "r" (row));
/* sub (widening to 16bit) */
/* p = b - c */
asm volatile ("vwsubu.vv v12, v4, v6");
/* pc = a - c */
asm volatile ("vwsubu.vv v24, v2, v6");
/* switch to widened */
asm volatile ("vsetvli zero, %0, e16, m2" : : "r" (bpp));
/* pa = abs(p) -> pa = p < 0 ? -p : p */
asm volatile ("vmv.v.v v16, v12"); /* pa = p */
asm volatile ("vmslt.vx v0, v16, zero"); /* set mask[i] if pa[i] < 0 */
asm volatile ("vrsub.vx v16, v16, zero, v0.t"); /* invert negative values in pa; vd[i] = 0 - vs2[i] (if mask[i])
* could be replaced by vneg in rvv >= 1.0
*/
/* pb = abs(p) -> pb = pc < 0 ? -pc : pc */
asm volatile ("vmv.v.v v20, v24"); /* pb = pc */
asm volatile ("vmslt.vx v0, v20, zero"); /* set mask[i] if pc[i] < 0 */
asm volatile ("vrsub.vx v20, v20, zero, v0.t"); /* invert negative values in pb; vd[i] = 0 - vs2[i] (if mask[i])
* could be replaced by vneg in rvv >= 1.0
*/
/* pc = abs(p + pc) -> pc = (p + pc) < 0 ? -(p + pc) : p + pc */
asm volatile ("vadd.vv v24, v24, v12"); /* pc = p + pc */
asm volatile ("vmslt.vx v0, v24, zero"); /* set mask[i] if pc[i] < 0 */
asm volatile ("vrsub.vx v24, v24, zero, v0.t"); /* invert negative values in pc; vd[i] = 0 - vs2[i] (if mask[i])
* could be replaced by vneg in rvv >= 1.0
*/
/*
* if (pb < pa)
* {
* pa = pb;
* a = b;
* // see (*1)
* }
*/
asm volatile ("vmslt.vv v0, v20, v16"); /* set mask[i] if pb[i] < pa[i] */
asm volatile ("vmerge.vvm v16, v16, v20, v0"); /* pa[i] = pb[i] (if mask[i]) */
/*
* if (pc < pa)
* {
* a = c;
* // see (*2)
* }
*/
asm volatile ("vmslt.vv v31, v24, v16"); /* set tmpmask[i] if pc[i] < pa[i] */
/* switch to narrow */
asm volatile ("vsetvli zero, %0, e8, m1" : : "r" (bpp));
/* (*1) */
asm volatile ("vmerge.vvm v2, v2, v4, v0"); /* a = b (if mask[i]) */
/* (*2) */
asm volatile ("vmand.mm v0, v31, v31"); /* mask = tmpmask
* vmand works for rvv 0.7 up to 1.0
* could be replaced by vmcpy in 0.7.1/0.8.1
* or vmmv.m in 1.0
*/
asm volatile ("vmerge.vvm v2, v2, v6, v0"); /* a = c (if mask[i]) */
/* a += x */
asm volatile ("vadd.vv v2, v2, v8");
/* *row = a */
asm volatile ("vse8.v v2, (%0)" : : "r" (row));
row += bpp;
/* prepare next iteration (prev is already in a) */
/* c = b */
asm volatile ("vmv.v.v v6, v4");
}
}
void
png_read_filter_row_paeth3_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_paeth_rvv(len, 3, row, prev_row);
PNG_UNUSED(prev_row)
}
void
png_read_filter_row_paeth4_rvv(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
size_t len = row_info->rowbytes;
png_read_filter_row_paeth_rvv(len, 4, row, prev_row);
PNG_UNUSED(prev_row)
}
#endif /* PNG_RISCV_RVV_IMPLEMENTATION */
#endif /* READ */

126
extlib/libpng/riscv/riscv_init.c vendored Normal file
View File

@ -0,0 +1,126 @@
/* riscv_init.c - RISC-V Vector optimized filter functions
*
* Copyright (c) 2023 Google LLC
* Written by Dragoș Tiselice <dtiselice@google.com>, May 2023.
* Filip Wasil <f.wasil@samsung.com>, March 2025.
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_RISCV_RVV_OPT > 0
#include <riscv_vector.h>
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the
* RISC-V Vector instructions there is no processor-specific way of detecting
* the presence of the required support, therefore run-time detection is
* extremely OS specific.
*
* You may set the macro PNG_RISCV_RVV_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_rvv function. There
* are a number of implementations in contrib/riscv-rvv, but the only one that
* has partial support is contrib/riscv-rvv/linux.c - a generic Linux
* implementation which reads /proc/cpuinfo.
*/
#include <signal.h>
#ifndef PNG_RISCV_RVV_FILE
# if defined(__linux__)
# define PNG_RISCV_RVV_FILE "contrib/riscv-rvv/linux.c"
# else
# error "No support for run-time RISC-V Vector checking; use compile-time options"
# endif
#endif
static int png_have_rvv(png_structp png_ptr);
#ifdef PNG_RISCV_RVV_FILE
# include PNG_RISCV_RVV_FILE
#endif
#endif /* PNG_RISCV_RVV_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
#endif
void
png_init_filter_functions_rvv(png_structp pp, unsigned int bpp)
{
/* The switch statement is compiled in for RISCV_RVV_API, the call to
* png_have_rvv is compiled in for RISCV_RVV_CHECK. If both are
* defined the check is only performed if the API has not set the VECTOR
* option on or off explicitly. In this case the check controls what
* happens.
*/
png_debug(1, "in png_init_filter_functions_rvv");
#ifdef PNG_RISCV_RVV_API_SUPPORTED
switch ((pp->options >> PNG_RISCV_RVV) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif /* PNG_RISCV_RVV_API_SUPPORTED */
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_rvv = -1; /* not checked */
if (no_rvv < 0)
no_rvv = !png_have_rvv(pp);
if (no_rvv)
return;
}
#ifdef PNG_RISCV_RVV_API_SUPPORTED
break;
#endif
#endif /* PNG_RISCV_RVV_CHECK_SUPPORTED */
#ifdef PNG_RISCV_RVV_API_SUPPORTED
default: /* OFF or INVALID */
return;
case PNG_OPTION_ON:
/* Option turned on */
break;
}
#endif /* PNG_RISCV_RVV_API_SUPPORTED */
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_rvv;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_rvv;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_rvv;
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_rvv;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_rvv;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_rvv;
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_rvv;
}
}
#endif /* PNG_RISCV_RVV_OPT > 0 */
#endif /* PNG_READ_SUPPORTED */

View File

@ -29,6 +29,7 @@ Author List
* Jeremy Maitin-Shepard
* John Bowler
* Jon Creighton
* Joost Nieuwenhuijse
* Kyle Bentley
* Martin Storsjö
* Owen Rudge

View File

@ -18,21 +18,21 @@ function(generate_chk)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GC_INPUT)
cmake_parse_arguments(_GENCHK "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GENCHK_INPUT)
message(FATAL_ERROR "generate_chk: Missing INPUT argument")
endif()
if(NOT _GC_OUTPUT)
if(NOT _GENCHK_OUTPUT)
message(FATAL_ERROR "generate_chk: Missing OUTPUT argument")
endif()
# Run genchk.cmake to generate the .chk file.
add_custom_command(OUTPUT "${_GC_OUTPUT}"
add_custom_command(OUTPUT "${_GENCHK_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GC_INPUT}"
"-DOUTPUT=${_GC_OUTPUT}"
"-DINPUT=${_GENCHK_INPUT}"
"-DOUTPUT=${_GENCHK_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake"
DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS}
DEPENDS "${_GENCHK_INPUT}" ${_GENCHK_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@ -42,21 +42,21 @@ function(generate_out)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GO_INPUT)
cmake_parse_arguments(_GENOUT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GENOUT_INPUT)
message(FATAL_ERROR "generate_out: Missing INPUT argument")
endif()
if(NOT _GO_OUTPUT)
if(NOT _GENOUT_OUTPUT)
message(FATAL_ERROR "generate_out: Missing OUTPUT argument")
endif()
# Run genout.cmake to generate the .out file.
add_custom_command(OUTPUT "${_GO_OUTPUT}"
add_custom_command(OUTPUT "${_GENOUT_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DINPUT=${_GO_INPUT}"
"-DOUTPUT=${_GO_OUTPUT}"
"-DINPUT=${_GENOUT_INPUT}"
"-DOUTPUT=${_GENOUT_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake"
DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS}
DEPENDS "${_GENOUT_INPUT}" ${_GENOUT_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@ -66,17 +66,17 @@ function(generate_source)
set(options)
set(oneValueArgs OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GSO_OUTPUT)
cmake_parse_arguments(_GENSRC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GENSRC_OUTPUT)
message(FATAL_ERROR "generate_source: Missing OUTPUT argument")
endif()
# Run gensrc.cmake to generate the source file.
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
add_custom_command(OUTPUT "${_GENSRC_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
"-DOUTPUT=${_GSO_OUTPUT}"
"-DOUTPUT=${_GENSRC_OUTPUT}"
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake"
DEPENDS ${_GSO_DEPENDS}
DEPENDS ${_GENSRC_DEPENDS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
@ -86,19 +86,19 @@ function(generate_copy)
set(options)
set(oneValueArgs INPUT OUTPUT)
set(multiValueArgs DEPENDS)
cmake_parse_arguments(_GCO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GCO_INPUT)
cmake_parse_arguments(_GENCPY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT _GENCPY_INPUT)
message(FATAL_ERROR "generate_copy: Missing INPUT argument")
endif()
if(NOT _GCO_OUTPUT)
if(NOT _GENCPY_OUTPUT)
message(FATAL_ERROR "generate_copy: Missing OUTPUT argument")
endif()
# Make a forced file copy, overwriting any pre-existing output file.
add_custom_command(OUTPUT "${_GCO_OUTPUT}"
add_custom_command(OUTPUT "${_GENCPY_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
-E remove "${_GCO_OUTPUT}"
-E remove "${_GENCPY_OUTPUT}"
COMMAND "${CMAKE_COMMAND}"
-E copy "${_GCO_INPUT}" "${_GCO_OUTPUT}"
DEPENDS "${source}" ${_GCO_DEPENDS})
-E copy "${_GENCPY_INPUT}" "${_GENCPY_OUTPUT}"
DEPENDS "${_GENCPY_INPUT}" ${_GENCPY_DEPENDS})
endfunction()

View File

@ -1,7 +1,7 @@
# genout.cmake.in
# Generate .out from .c with awk (generic), based upon the automake logic.
# Copyright (c) 2022-2024 Cosmin Truta
# Copyright (c) 2022-2025 Cosmin Truta
# Copyright (c) 2016 Glenn Randers-Pehrson
# Written by Roger Leigh, 2016
#
@ -16,6 +16,7 @@
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(APPLE "@APPLE@")
set(AWK "@AWK@")
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_FLAGS @CMAKE_C_FLAGS@)

View File

@ -21,8 +21,8 @@ set(DFA_XTRA "@DFA_XTRA@")
set(PNG_PREFIX "@PNG_PREFIX@")
set(PNGLIB_VERSION "@PNGLIB_VERSION@")
if(OUTPUT STREQUAL "scripts/pnglibconf.c")
# Generate scripts/pnglibconf.c
if(OUTPUT MATCHES "(scripts/pnglibconf\\.c)\$")
# Generate "${BINDIR}/scripts/pnglibconf.c"
file(REMOVE "${BINDIR}/pnglibconf.tf6" "${BINDIR}/pnglibconf.tf7")
@ -49,8 +49,8 @@ if(OUTPUT STREQUAL "scripts/pnglibconf.c")
file(MAKE_DIRECTORY "${BINDIR}/scripts")
file(RENAME "pnglibconf.tf7" "${BINDIR}/scripts/pnglibconf.c")
elseif(OUTPUT STREQUAL "pnglibconf.c")
# Generate pnglibconf.c
elseif(OUTPUT MATCHES "(pnglibconf\\.c)\$")
# Generate "${BINDIR}/pnglibconf.c"
file(REMOVE "${BINDIR}/pnglibconf.tf4" "${BINDIR}/pnglibconf.tf5")
@ -76,10 +76,10 @@ elseif(OUTPUT STREQUAL "pnglibconf.c")
file(MAKE_DIRECTORY "${BINDIR}/scripts")
file(RENAME "pnglibconf.tf5" "${BINDIR}/pnglibconf.c")
elseif(OUTPUT STREQUAL "pnglibconf.h")
# Generate pnglibconf.h
elseif(OUTPUT MATCHES "(pnglibconf\\.h)\$")
# Generate "${BINDIR}/pnglibconf.h"
file(REMOVE "${BINDIR}/${OUTPUT}")
file(REMOVE "${OUTPUT}")
if(PNG_PREFIX)
file(REMOVE "pnglibconf.tf8")
@ -95,20 +95,21 @@ elseif(OUTPUT STREQUAL "pnglibconf.h")
message(FATAL_ERROR "Failed to generate pnglibconf.tf8")
endif()
file(RENAME "pnglibconf.tf8" "${BINDIR}/${OUTPUT}")
file(RENAME "pnglibconf.tf8" "${OUTPUT}")
else()
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${BINDIR}/pnglibconf.out"
"${BINDIR}/${OUTPUT}"
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "pnglibconf.out"
"${OUTPUT}"
WORKING_DIRECTORY "${BINDIR}"
RESULT_VARIABLE COPY_FAIL)
if(COPY_FAIL)
message(FATAL_ERROR "Failed to create pnglibconf.h")
endif()
endif()
elseif(OUTPUT STREQUAL "pngprefix.h")
# Generate pngprefix.h
elseif(OUTPUT MATCHES "(pngprefix\\.h)\$")
# Generate "${BINDIR}/pngprefix.h"
file(REMOVE "${BINDIR}/${OUTPUT}")
file(REMOVE "${OUTPUT}")
if(PNG_PREFIX)
file(REMOVE "pngprefix.tf1")
@ -122,12 +123,12 @@ elseif(OUTPUT STREQUAL "pngprefix.h")
message(FATAL_ERROR "Failed to generate pngprefix.tf1")
endif()
file(RENAME "pngprefix.tf1" "${BINDIR}/${OUTPUT}")
file(RENAME "pngprefix.tf1" "${OUTPUT}")
else()
file(WRITE "${BINDIR}/${OUTPUT}" "/* No libpng symbol prefix configured. */")
file(WRITE "${OUTPUT}" "/* No libpng symbol prefix configured. */")
endif()
elseif(OUTPUT STREQUAL "scripts/pnglibconf.h.prebuilt")
elseif(OUTPUT MATCHES "(scripts/pnglibconf\\.h\\.prebuilt)\$")
# Generate scripts/pnglibconf.h.prebuilt (fails build)
message(STATUS "Attempting to build scripts/pnglibconf.h.prebuilt")

View File

@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.6.48
version=1.6.49
prefix=""
libdir=""
libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
Version: 1.6.48
Version: 1.6.49
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}

View File

@ -22,7 +22,8 @@ RM_F = rm -f
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors -std=c89
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -21,7 +21,8 @@ RM_F = rm -f
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors # -std=c99
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -28,7 +28,8 @@ RM_F=rm -f
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -21,7 +21,8 @@ RM_F = rm -f
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors # -std=c99
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -26,7 +26,8 @@ RM_F=rm -f
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -32,7 +32,8 @@ LN_SF = ln -sf
# Compiler and linker flags
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
STDC = -pedantic-errors
WARN = -Wall -Wextra -Wundef
WARNMORE = -Wcast-align -Wconversion -Wshadow -Wpointer-arith -Wwrite-strings \

View File

@ -23,7 +23,8 @@ RM_F = rm -f
AWK = awk
NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
-DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0 \
-DPNG_RISCV_RVV_OPT=0
DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build
DFA_EXTRA = # extra files that can be used to control configuration
CPPFLAGS = -I$(ZLIBINC) $(NOHWOPT) # -DPNG_DEBUG=5

View File

@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.48 */
/* libpng version 1.6.49 */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.5...3.10)
project(cmake_install_test LANGUAGES C)

View File

@ -191,12 +191,16 @@ if(MZ_LIBCOMP)
endif()
if(MZ_ZLIB)
# rom-properties: Don't check for ZLIB/ZLIBNG here.
# We've already checked for it.
IF(0)
# Check if zlib is present
if(NOT MZ_FORCE_FETCH_LIBS)
find_package(ZLIBNG QUIET)
find_package(ZLIB QUIET)
set(ZLIB_VERSION ${ZLIB_VERSION_STRING})
endif()
ENDIF(0) # rom-properties
if(ZLIBNG_FOUND AND NOT MZ_FORCE_FETCH_LIBS)
message(STATUS "Using ZLIBNG")

View File

@ -1,9 +1,9 @@
This copy of minizip-ng 4.0.9 is a modified version of the original.
This copy of minizip-ng 4.0.10 is a modified version of the original.
commit 95ba7abdd24a956bde584db54d1d55e37d511e2f
Version 4.0.9.
commit f3ed731e27a97e30dffe076ed5e0537daae5c1bd
Version 4.0.10.
Tag: 4.0.9
Tag: 4.0.10
The following changes have been made to the original:
@ -23,7 +23,7 @@ The following changes have been made to the original:
- project(): Disabled DESCRIPTION and HOMEPAGE_URL due to requiring
newer versions of CMake than what's available in Ubuntu 16.04.
To obtain the original minizip-ng 4.0.9, visit:
To obtain the original minizip-ng 4.0.10, visit:
https://github.com/zlib-ng/minizip-ng
To obtain the original minizip-1.1, visit:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -147,6 +147,7 @@ ADD_SUBDIRECTORY(amiibo-data)
ADD_SUBDIRECTORY(libromdata)
IF(BUILD_CLI)
ADD_SUBDIRECTORY(libgsvt)
ADD_SUBDIRECTORY(rpcli)
ENDIF(BUILD_CLI)
IF(ENABLE_NETWORKING)

Some files were not shown because too many files have changed in this diff Show More