summaryrefslogtreecommitdiff
path: root/Userland/Utilities
AgeCommit message (Collapse)Author
2023-02-19LibTextCodec+Everywhere: Port Decoders to new StringsSam Atkins
2023-02-19LibTextCodec+Everywhere: Return Optional<Decoder&> from `decoder_for()`Sam Atkins
2023-02-19LibDeviceTree: Add a slow, allocation-free property fetch APIAndrew Kaster
Using the walk_device_tree helper, we can walk the device tree from the beginning looking for a specific property node. It's still missing the ability to get property lists, string lists, and property-specific data.
2023-02-19LibDeviceTree: Refactor dump() to return ErrorOr, and use ReadonlyBytesAndrew Kaster
ReadonlyBytes is much nicer to use than a u8 const* + size_t.
2023-02-19js: Save REPL history when exiting interpreter with `exit()`Evan Smal
Previously, we only saved the REPL history when the interpreter was shutdown with a signal. This change ensures that we save the history when a user uses `exit()`.
2023-02-18LibGfx: Rename `JPGLoader` to `JPEGLoader`Lucas CHOLLET
The patch also contains modifications on several classes, functions or files that are related to the `JPGLoader`. Renaming include: - JPGLoader{.h, .cpp} - JPGImageDecoderPlugin - JPGLoadingContext - JPG_DEBUG - decode_jpg - FuzzJPGLoader.cpp - Few string literals or texts
2023-02-17icc: Add flags for writing and dumping profilesNico Weber
This adds three flags to icc: * --reencode-to=<file> re-serializes a profile to a given file, using Gfx::ICC::encode(). This is mainly useful for testing that code. * --dump-to=<file> dumps the raw ICC profile bytes read from the input to disk. This is useful for extracting ICC profiles from images, and for comparing the raw profile bytes to the profile bytes written by --reencode-to=. If either of these flags is passed, icc by default no longer dumps the icc data to stdout. To force priting of the data even if either of these flags is present, this also adds: * --print, which forces printing ICC contents, even if either or both of the icc-data writing flags are present.
2023-02-17LibJS+Everywhere: Convert JS::Error to StringTimothy Flynn
This includes an Error::create overload to create an Error from a UTF-8 StringView. If creating a String from that view fails, the factory will return an OOM InternalError instead. VM::throw_completion can also make use of this overload via its perfect forwarding.
2023-02-16su: Only check for an interactive tty if a password is actually neededKarol Baraniecki
2023-02-16su: Allow to specify a command to be executed by -cKarol Baraniecki
su -c 'echo yeah'
2023-02-15LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringViewSam Atkins
We don't need a full String/DeprecatedString inside this function, so we might as well not force users to create one.
2023-02-13Everywhere: Remove the `AK::` qualifier from Stream usagesTim Schumacher
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Move Stream-based sockets into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-02-13icc: Dump embedded non-parametric curves in lutAToBType and lutAToBTypeNico Weber
2023-02-13icc: Dump embedded parametric curves in lutAToBType and lutAToBTypeNico Weber
2023-02-13icc: Dump more information about curves in lutAToBType and lutAToBTypeNico Weber
2023-02-12Utilities/arp: Don't unveil /tmp/portal/lookup for numerical outputLiav A
It's not needed in such case, and in the near-future when we would want to use this utility in an initramfs environment where there's no service such as LookupServer being running, it's still useful to have the option to invoke this utility with the mentioned limited output functionality.
2023-02-12LibArchive: Add support for modification time and dateOllrogge
2023-02-12icc: Dump some of lutAToBType and lutBToAType curve dataNico Weber
2023-02-12Utilities/netstat: Don't unveil /tmp/portal/lookup for numerical outputLiav A
It's not needed in such case, and in the near-future when we would want to use this utility in an initramfs environment where there's no service such as LookupServer being running, it's still useful to have the option to invoke this utility with the mentioned limited output functionality.
2023-02-10LibJS+Userland: Port the JS Console object and direct callers to StringTimothy Flynn
2023-02-10LibGfx+icc: Stringify known signatureType valuesNico Weber
2023-02-10LibGfx+icc: Read chromaticityTagNico Weber
This isn't terribly useful. But some profiles, for example the ones at https://vpifg.com/help/icc-profiles/, do contain this tag and it seems nice to be able to dump it, just for completeness. I haven't seen any files that contain a phosphor or colorant type different from "Unknown", even for the Rec2020 profile on that page. (It has x,y coordinates that match the values required for Rec2020, but it doesn't set the phosphor or colorant type to that.)
2023-02-10LibGfx+icc: Read viewingConditionsTypeNico Weber
Not terribly useful in practice either and also mostly for completionism. But with this, we can dump all types present in Lightroom Classic-exported jpegs :^)
2023-02-10LibGfx+icc: Read measurementTypeNico Weber
Also not terribly useful in practice and mostly for completionism. Lightroom Classic-exported jpegs contain this type in their ICC data.
2023-02-10AK+Everywhere: Do not implicitly copy variables in TRY macrosTimothy Flynn
For example, consider cases where we want to propagate errors only in specific instances: auto result = read_data(); // something like ErrorOr<ByteBuffer> if (result.is_error() && result.error().code() != EINTR) continue; auto bytes = TRY(result); The TRY invocation will currently copy the byte buffer when the expression (in this case, just a local variable) is stored into _temporary_result. This patch binds the expression to a reference to prevent such copies. In less trival invocations (such as TRY(some_function()), this will incur only temporary lifetime extensions, i.e. no functional change.
2023-02-10Everywhere: Remove needless copies of Error / ErrorOr instancesTimothy Flynn
Either take the underlying objects with release_* methods or move() the instances around.
2023-02-09icc: Call video_full_range_flag_to_string()Nico Weber
2023-02-08LibGfx+icc: Implement half of lutAToBType and lutBToATypeNico Weber
These are among the permitted tag types of ATo0Tag and BToA0Tag, which are among the required tags of most profiles. They are the last permitted tag types for those profiles (the other are lut8Type or lut16Type, which are already implemented). They are pretty chonky types though, so this only implements support for the E matrix and the CLUT. Support for the various curves will be in a future PR.
2023-02-08AK: Remove the fallible constructor from `FixedMemoryStream`Tim Schumacher
2023-02-08js: Remove DeprecatedString usage in `load_json_impl()`Evan Smal
2023-02-08js: Use const where possible in `parse_and_run()`Evan Smal
2023-02-08js: Convert `s_history_path` to String and propagate errorsEvan Smal
2023-02-08js: Use `Core::Stream::File` in place of POSIX in `write_to_file()`Evan Smal
2023-02-08js: Use String in `prompt_for_level()` and `read_next_piece()`Evan Smal
2023-02-08LibGfx+icc: Read cicpTypeNico Weber
This is a very new tag used for HDR content. The only files I know that use it are the jpegs on https://ccameron-chromium.github.io/hdr-jpeg/ But they have an invalid ICC creation date, so `icc` can't process them. (Commenting out the check for that does allow to print them.) If the CIPC tag is present, it takes precedence about the actual data in the profile and from what I understand, the ICC profile is basically ignored. See https://www.color.org/events/HDR_experts.xalter for background, in particular https://www.color.org/hdr/02-Luke_Wallis.pdf (but the other talks are very interesting too). (PNG also has a cICP chunk that's supposed to take precedence over iCCP.)
2023-02-08LibGfx+icc: Read signatureTypeNico Weber
This isn't used by any mandatory tags, and it's not terribly useful. But jpegs exported by Lightroom Classic write the 'tech' tag, and it seems nice to be able to dump its contents. signatureType stores a single u32 which for different tags with this type means different things. In each case, the value is one from a short table of valid values, suggesting this should be a per-tag enum class instead of a per-tag DistinctFourCC, per the comment at the top of DistincFourCC.h. On the other hand, 3 of the 4 tables have an explicit "It is possible that the ICC will define other signature values in the future" note, which suggests the FourCC might actually be the way to go. For now, just punt on that and manually dump the u32 in fourcc style in icc.cpp and don't add any to_string() methods that return a readable string based on the contents of these tables.
2023-02-08LibGfx+icc: Read namedColor2TypeNico Weber
This is the type of namedColor2Tag, which is a required tag in NamedColor profiles. The implementation is pretty basic for now and only exposes the numbers stored in the file directly (after endian conversion).
2023-02-04Utilities: Rename special target binaries only if they existKarol Kosek
Before 6490529ef76ebf37f9e58bf76c6271be6842afa1, all programs in the SPECIAL_TARGETS list were built because they didn't have an EXCLUDE_FROM_ALL property set. That commit set the property for all targets, but because of this, the minimal "Required" build configuration no longer built, as CMake failed to rename every special target. Even the not built ones. This commit makes the rename action run only if the executable exists, which makes us build Serenity without the `install` utility, and also by using the minimal configuration set. :^) :^)
2023-02-03LibSQL+Userland: Pass SQL IPC results to clients in a structureTimothy Flynn
SQLClient exists as a wrapper around SQL IPC to provide a bit friendlier interface for clients to deal with. Though right now, it mostly forwards values as-is from IPC to the clients. This makes it a bit verbose to add values to IPC responses, as we then have to add it to the callbacks used by all clients. It's also a bit confusing seeing a sea of "auto" as the parameter types for these callbacks. This patch moves these response values to named structures instead. This will allow adding values without needing to simultaneously update all clients. We can then separately handle the new values in interested clients only.
2023-02-03grep: Port to `Core::Stream`Lucas CHOLLET
It also adds support for `ErrorOr` in one lambda.
2023-02-03Utilities/w: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-02-03Utilities/route: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-02-03Utilities/pmap: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-02-03Utilities/netstat: Replace uses of JsonObject::get_deprecated()/get_ptrSam Atkins
2023-02-03Utilities/mount: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-02-03Utilities/lsusb: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins