Recent

Author Topic: unit FPimage causes "Adobe ImageReady" in binary. Why?  (Read 1275 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
unit FPimage causes "Adobe ImageReady" in binary. Why?
« on: December 05, 2020, 02:12:07 am »
Hi!

Just noticed while searching something different:

Whenever I include FPimage in the uses section
then the binary  contains a string

Code: Text  [Select][+][-]
  1. Adobe ImageReady

Why?

Without starting your own project you can detect this string in the
fcl packages:

Code: Text  [Select][+][-]
  1. grep -ir 'Adobe ImageReady' *
  2. grep: 3.0.4/packages/fcl-pdf/tests/lib/x86_64-linux/unittests_gui.or: binary file matches
  3. grep: 3.0.4/packages/fcl-pdf/tests/unittests_gui: binary file matches

I searched extensive in the source but could not find it.

Winni


« Last Edit: December 05, 2020, 02:13:49 am by winni »

dsiders

  • Hero Member
  • *****
  • Posts: 1045
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #1 on: December 05, 2020, 04:49:43 am »
Hi!

Just noticed while searching something different:

Whenever I include FPimage in the uses section
then the binary  contains a string

Code: Text  [Select][+][-]
  1. Adobe ImageReady

Why?

Without starting your own project you can detect this string in the
fcl packages:

Code: Text  [Select][+][-]
  1. grep -ir 'Adobe ImageReady' *
  2. grep: 3.0.4/packages/fcl-pdf/tests/lib/x86_64-linux/unittests_gui.or: binary file matches
  3. grep: 3.0.4/packages/fcl-pdf/tests/unittests_gui: binary file matches

I searched extensive in the source but could not find it.

Winni

Apparently, this is resource metadata for some image (or resource using the image) built with Adode ImageReady, PhotoShop, or Creative Suite. It's in lazarus/images/bookmark.res and several images. It's also in fcl-pdf.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #2 on: December 05, 2020, 02:23:53 pm »
Hi!

Thanx dsiders! That has't come to my mind.

I think as we work on open source we should get rid of the Adobe metadata.

Solution 1: Load all the files containing Adobe ImageReady into Gimp or LazPaint and do a "Save as" with the same filename.

Solution 2: Use this script:

Code: Bash  [Select][+][-]
  1. #!/bin/bash
  2.  
  3. # /scripts/NoAdobe winni 5.12.2020
  4.  
  5. laz=/usr/lib64/lazarus/
  6. fpc=/usr/share/fpcsrc/
  7. Adobe='Adobe\ ImageReady'
  8. WeAre='fpc\ and\ Lazarus '
  9.  
  10. for dir in $laz $fpc
  11. do
  12. find $dir  -type f   \( -iname "*.png" -o -iname "*.res" \) | { while read fname
  13.     do
  14.     grep "$Adobe"  "$fname"
  15.     if [ $? -eq 0 ]
  16.         then
  17.         echo 'YES'
  18.         echo $fname
  19.         # backup  
  20.         cp "$fname" "$fname"_old  
  21.         cat "$fname" | sed 's/'"$Adobe"'/'"$WeAre"'/g' > "$fname"
  22.     fi
  23.  
  24.     done }
  25.    
  26. done
  27.  

Winni

dsiders

  • Hero Member
  • *****
  • Posts: 1045
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #3 on: December 05, 2020, 05:43:57 pm »
Hi!

Thanx dsiders! That has't come to my mind.

I think as we work on open source we should get rid of the Adobe metadata.

Solution 1: Load all the files containing Adobe ImageReady into Gimp or LazPaint and do a "Save as" with the same filename.

Solution 2: Use this script:

Code: Bash  [Select][+][-]
  1. #!/bin/bash
  2. # /scripts/NoAdobe winni 5.12.2020
  3. ...
  4.  
  5.  

Winni


Well, you'll still see it if you use third party resources that include the metadata. I found these files:

In Lazarus:

Code: Diff  [Select][+][-]
  1. components/fppkg/images/archive.png
  2. components/fppkg/images/download.png
  3. images/bookmark.res
  4. images/menu/bug_small.png
  5. images/sourceeditor/tsynsyncroedit.png
  6. lcl/dialog_icons.res
  7. lcl/images/dialogs/dialog_shield.png
  8. lcl/images/dock/lcl_dock_to_bottom.png
  9. lcl/images/dock/lcl_dock_to_left.png
  10. lcl/images/dock/lcl_dock_to_right.png
  11. lcl/images/dock/lcl_dock_to_top.png
  12. lcl/images/wince/wincedialog_cancel.png
  13. lcl/lcl_dock_to_images.res
  14. components/onlinepackagemanager/images/Tree_Buttons/00 Repository.png
  15. components/onlinepackagemanager/images/Tree_Buttons/10 License.png
  16. components/onlinepackagemanager/images/Tree_Buttons/14 RepositorySize.png
  17. components/onlinepackagemanager/images/Tree_Buttons/16 RepositoryDate.png
  18. components/onlinepackagemanager/images/Tree_Buttons/FileVersion.png
  19.  

In FPC:

Code: Diff  [Select][+][-]
  1. fpc/3.2.0/source/packages/fcl-pdf/examples/diamond.png

In Third Party:

Code: Diff  [Select][+][-]
  1. components/bgracontrols/icons/bclabel_icon.lrs
  2. components/bgracontrols/icons/bcsvgbutton.lrs
  3. components/bgracontrols/icons/bgraspriteanimation_icon.lrs

And I don't use that many third party controls.

Other than symbol purity, why is this an issue?
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #4 on: December 05, 2020, 06:40:35 pm »
Other than symbol purity, why is this an issue?

While a small one, it's nevertheless an issue because it "fattens" the final binary while adding nothing at all. I mean, who cares whether the icons embeded in my program were edited with some Adobe (or whoever else's) software? Say there a hundred icons, all of them with "Adobe ImageReady": that wastes 16*100 = 1,6 KiB, and it indicates that there is probably even more useless metadata ocupying more KiB.

Yeah, all in all it might be a trivial question of a few KiB for most of us but for some it might be relatively important and it's a completely useless waste.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #5 on: December 05, 2020, 06:52:24 pm »
I'm not a lawyer. But I doubt that we are not allowed to remove any meta data, unless there is some less restrictive license on these images, but I don't even know where these images come from. So why risk a law suite with some money-eager lawyer just for a few bytes?

And I even could imagine that these meta data (it's the IPTC meta data in this case which begin with an "Adobe" identifying string) are useful for somebody. Replacing the "Adobe" by something else will definitely destroy IPTC.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: unit FPimage causes "Adobe ImageReady" in binary. Why?
« Reply #6 on: December 05, 2020, 08:47:47 pm »
Oh gosh!!!

Why are you so afraid of the lawyers. They are the human's  best friend!
If they could do something useful perhaps they would become humans!

Nearly every image format has a comment field. Most the applications write
their name in it. By default this is done by the application which made the last
change.

If you want humourous, anoying and pubescent  comments then you should have a look into the animated Gifs. In the comment field.

So it is not a crime, Everybody does this.  Adobe, Gimp, Corel, Microsoft. And a horde of young boys.

I don't like Adobe. In the early days of image processing they bought all these little companies to get the monopol. I learned to work with image with the help of the PhotoStyler. Version 2.0 appeared and after that Adobe had bought it and it disappeared. [ Today this is for free in some museum ].

Not a big issue. But one of the loose ends where we should care about Open Source.

Winni
« Last Edit: December 05, 2020, 08:56:47 pm by winni »

 

TinyPortal © 2005-2018