透過網頁讀取Photoshop PSD檔案內容
在專案中有需要透過網頁來讀取Photoshop PSD檔案的內部資訊,我們透過PSD.js(備用載點)來實現這樣的功能,在官方提供的功能展示頁中,我們可以看到在頁面中只需引入psd.min.js後,加入透過少量的Javascript就可以針對PSD進行解析。
<!DOCTYPE html> <html> <head> <title>psd.js image example</title> <style type="text/css"> body, html { padding: 0; margin: 0; } #dropzone { width: 500px; height: 100px; border: 1px #ababab dashed; margin: 50px auto; } #dropzone p { text-align: center; line-height: 100px; margin: 0; padding: 0; } #image { text-align: center; } </style> <script type="text/javascript" src="psd.min.js"></script> </head> <body> <div id="dropzone"> <p>Drop here</p> </div> <div id="image"></div> <pre id="data"></pre> <script type="text/javascript"> (function () { var PSD = require('psd'); document.getElementById('dropzone').addEventListener('dragover', onDragOver, true); document.getElementById('dropzone').addEventListener('drop', onDrop, true); function onDragOver(e) { e.stopPropagation(); e.preventDefault(); e.dataTransfer.dropEffect = 'copy'; } function onDrop(e) { e.stopPropagation(); e.preventDefault(); PSD.fromEvent(e).then(function (psd) { var data = JSON.stringify(psd.tree().export(), undefined, 2); document.getElementById('data').innerHTML = data; document.getElementById('image').appendChild(psd.image.toPng()); }); } }()); </script> </body> </html>
我們透過下圖這樣的一個PSD檔案對頁面進行測試,檔案中共有三個圖層,包含一個文字圖層。
![](https://cloudlab.tw/wp/wp-content/uploads/2020/04/2020-01-14_091102.png)
頁面將PSD分析出結果後,以json格式顯示在頁面上,可以看到文字圖層的部分,不僅能讀到圖層名稱也包含文字內容和字型名稱。
{ "children": [ { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "Photoshop Text", "left": 302, "right": 723, "top": 90, "bottom": 128, "height": 38, "width": 421, "mask": {}, "text": { "value": "THIS IS TEXT LAYER", "font": { "name": "MyriadPro-Regular\u0000", "sizes": [ 53 ], "colors": [ [ 0, 0, 0, 255 ] ], "alignment": [ "center" ] }, "left": 0, "top": 0, "right": 0, "bottom": 0, "transform": { "xx": 1, "xy": 0, "yx": 0, "yy": 1, "tx": 513, "ty": 127 } }, "image": {} }, { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "PSD Icon", "left": 287, "right": 738, "top": 209, "bottom": 669, "height": 460, "width": 451, "mask": {}, "image": {} }, { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "Background", "left": 0, "right": 1024, "top": 0, "bottom": 800, "height": 800, "width": 1024, "mask": {}, "image": {} } ], "document": { "width": 1024, "height": 800, "resources": { "layerComps": [], "guides": [], "slices": [] } } }
az parayla cok kazandiran slot oyunlar?: en kazancl? slot oyunlar? – guvenilir slot siteleri
Aerodrome Finance: Unlocking Potential for Growth
The world of aerodrome finance is pivotal for ensuring the efficient operation, enhancement, and expansion of aerodrome facilities globally. With the increasing demand for air travel, understanding aerodrome financial processes is more important than ever.
aerodrome finance
Why Aerodrome Finance Matters
Aerodrome finance plays a critical role in the lifespan of airport projects, providing necessary funding from initial development to ongoing management. Here are key reasons why it matters:
Infrastructure Development: Secure financial backing enables the construction and maintenance of essential airport infrastructure.
Operational Efficiency: Adequate funding ensures that airports can operate smoothly, adapting to technological advancements and logistical demands.
Economic Growth: Airports serve as economic hubs; their development stimulates job creation and boosts local economies.
Aerodrome Finance Strategies
Various strategies can be employed to optimize aerodrome finance, ensuring both immediate and long-term benefits. Here are a few notable approaches:
Public-Private Partnerships (PPP)
These partnerships combine public sector oversight and private sector efficiency, leading to shared risks and rewards. They facilitate diverse financial resources and innovative solutions for airport projects.
Revenue Diversification
Exploring non-aeronautical revenue streams, such as retail concessions and property leases, can significantly bolster an airport’s financial resilience. Such diversification allows for a steady income flow independent of ticket sales.
Sustainable Financing
Adopting sustainable financial practices, including green bonds and ESG (Environmental, Social, and Governance) criteria, aligns with modern ecological standards and attracts environmentally conscious investors.
Challenges and Opportunities
While aerodrome finance offers numerous benefits, it also poses certain challenges. High capital costs, regulatory hurdles, and fluctuating passenger demands can impact financial stability. However, these challenges also present opportunities for innovation and improvement.
Tech-Driven Solutions: Embracing technology like AI and predictive analytics can enhance decision-making and financial planning.
Collaboration: Strengthening ties with stakeholders, including airlines and government agencies, can streamline financial operations and capital investments.
Ultimately, the goal of aerodrome finance is to support the sustainable growth and modernization of airports, ensuring their pivotal role in global connectivity remains strong.
https://sweetbonanza25.com/# sweet bonanza demo oyna
Внимание, гейы!
Готовы окунуться в пространство виртуальных-казино и выиграть действительные финансы? Тогда вам сюда! Список лучших лучших игровых сайтов 2025
Наш телеграм-профиль — ваш путеводитель в пространство отличных виртуальных-игр в Российской Федерации! Мы собрали топ-10 проверенных игровых сайтов, где вы получите возможность проводить время на деньги и получить свои выигрыши без проблем.
Что вас поджидает:
Достоверные мнения и ранги Безопасные и надежные казино 2025 года наш рейтинг от реальных участников. Превосходная статус любого ресурса гарантирована временем и игроками. Безоплатная регистрация и скорый вход на каждой сайтах. Активные дубликаты для входа к вашему любимому игровой площадке в любой момент. Мобильная софт для удобной игры там хотите.
Почему нас?
Безопасные и надежные казино с превосходными условиями для развлечения. Защита ваших данных и транзакций гарантирована. Новые события и новости мира интернет-развлечений в РФ.
rubber stamp maker online rubber stamp maker online .
stamp maker online stamp maker online .
stamps maker stamps maker .
online stamp creator online stamp creator .
Как не попасть впросак при покупке диплома колледжа или ПТУ в России
click resources https://todoprogramas.com/2024/06/13/keajaiban-qqmobil-slot-petualangan-menang-di-dunia-digital/
deneme bonusu veren siteler yeni: denemebonusuverensiteler25 – denemebonusuverensiteler25
stamp making online [url=http://stamp-creator-online0.com/]stamp making online[/url] .
sweet bonanza kazanma saatleri: sweet bonanza oyna – sweet bonanza yorumlar
have a peek at this website https://glassartistsfellowship.com/2024/06/13/slot-online-terpercaya-pandora188-pilihan-terbaik-untuk-penggemar-judi-daring/
casino bahis siteleri Casino Siteleri Casino Siteleri
купить аттестат в белгороде
http://sweetbonanza25.com/# sweet bonanza oyna
stamp creator online stamp creator online .
slot casino siteleri az parayla cok kazandiran slot oyunlar? slot casino siteleri
вывод из запоя цена ростов вывод из запоя цена ростов .
срочный вывод из запоя ростов срочный вывод из запоя ростов .
Бесплатное программное обеспечение для видеонаблюдения на ПК для распознавания лиц поддерживает все типы IP камер. Это комплексное решение, включающее VMS и CMS, позволяет записывать и просматривать RTSP-видеопотоки, а также управлять большим количеством IP-камер с единой платформы. Встроена видеоаналитика на основе ИИ, которая обнаруживает объекты в кадре, распознает автомобильные номера и лица, а также выявляет признаки дыма и огня.
как отключить распознавание лица
sweet bonanza yorumlar sweet bonanza giris sweet bonanza giris
slotozal casino
вывод из запоя ростов-на-дону вывод из запоя ростов-на-дону .
https://slotsiteleri25.com/# guvenilir slot siteleri
прокапаться от алкоголя на дому прокапаться от алкоголя на дому .
вывод из запоя круглосуточно ростов вывод из запоя круглосуточно ростов .
https://sweetbonanza25.com/# sweet bonanza giris
http://casinositeleri25.com/# Casino Siteleri