*New 12.1 series Release:
2019-11-08: XigmaNAS 12.1.0.4.7091 - released!

*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

script for convert icon to .c file

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
alexey123
Moderator
Moderator
Posts: 1563
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

script for convert icon to .c file

#1

Post by alexey123 » 28 Oct 2014 21:05

I put it here because i can lost it from my computer :oops:

Code: Select all

<?php
$name="icon_name.jpg";
$path2f = "/mnt/path/to/folder/with/icon/";
$file = bin2hex(file_get_contents ($path2f.$name));
$file=chunk_split($file,2,"\\x");
$file= "\\x" . substr($file,0,-2);
$result=chunk_split ($file, 96, "\"\n\t\t\"");//insert "\t" symbols as need for source
print ($result);
File_put_contents($path2f . $name . ".c", $result);
?>
Home11.0.0.4 - Sayyadina (revision 4249)/ x64-embedded on SAPPHIRE Pure Mini E350 / 8G RAM / UPS Ippon Back Power Pro 600
Lab 10.2.0.2 - Prescience (revision 2545) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
New XigmanasXigmaNAS version 11.2.0.4.6026 on x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM
TEST1 11.0.0.4 - Pilingitam (revision 4333) bpi-embedded on Allwinner a20 / 1015MiB RAM

biggsy
experienced User
experienced User
Posts: 80
Joined: 02 Jul 2012 10:24
Location: Sydney, Australia
Status: Offline

Re: script for convert icon to .c file

#2

Post by biggsy » 29 Oct 2014 08:49

alexey123 wrote:I put it here because i can lost it from my computer :oops:
Not taking backups Alexey? :lol:

Post Reply

Return to “Do It Yourself Projects”