posting_zon 3.111.010 → 3.111.013

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/posting_zon.rb +176 -261
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73154fba9b419381dedaf9ded5eb32ed6054e60db1997f27714386b408a08324
4
- data.tar.gz: ee4f919f5d89ded124c77184a32bd5970d4ff7c0ac525d60295c672e70df58bc
3
+ metadata.gz: 4301ae2be14ea54ebc9ba66f1edbc5fb2bea8d9e2cde21758c6a42f5512abcc9
4
+ data.tar.gz: 36f7b33ef365df82df3b0f6dba2adfad0a42e9a43c3ea927aa25bb99c15e8230
5
5
  SHA512:
6
- metadata.gz: a47ddade45a6e64710d12c672572aadedf931653c2bbbe2934df1b6387f2ecb205b95c9b6bb6d26e821374e09a71a081b686b946ab88c5d2cfef2dc77aedc613
7
- data.tar.gz: 54f814fbddda272c5db6907164de31099fbcac874d2d3bcf29e65e295277b8075a15b4a856261a4c7443bad33f452dcd53eca3d2035b5462c87fc5ad6e1f0edf
6
+ metadata.gz: 1d74e827c7075447a3a923846a5f4ea21350e205f2b52878169f11be3f0de04d2e9e8b27cde94a8f14c20a06d0325f84d42a7bef42d0e3f866f8bae54b4f4aeb
7
+ data.tar.gz: 8095ede268aab0690be3b0f5c5c684af84b04edda93734fdea51e2df167b9ee426dbb7ad0b521d41e9baf84eed6a7c2fe7e303a1c238ddb406419bbe8abeb9f5
data/lib/posting_zon.rb CHANGED
@@ -6891,11 +6891,19 @@ begin
6891
6891
  puts '-[√] 닉네임 26코드 타겟.......'.yellow
6892
6892
  rescue
6893
6893
  begin
6894
+ @driver.find_element(xpath: '//input[@type="text" and @title="글쓴이"]').clear
6895
+ sleep(1)
6894
6896
  @driver.find_element(xpath: '//input[@type="text" and @title="글쓴이"]').send_keys(user_id)
6895
6897
  sleep(1)
6896
6898
  puts '-[√] 닉네임 27코드 타겟.......'.yellow
6897
6899
  rescue
6898
-
6900
+ begin
6901
+ @driver.find_element(xpath: '//input[@type="text" and @name="member_display"]').send_keys(user_id)
6902
+ sleep(1)
6903
+ puts '-[√] 닉네임 28코드 타겟.......'.yellow
6904
+ rescue
6905
+
6906
+ end
6899
6907
  end
6900
6908
  end
6901
6909
  end
@@ -7046,7 +7054,13 @@ begin
7046
7054
  sleep(1)
7047
7055
  puts '-[√] 패스워드 21코드 타겟.......'.yellow
7048
7056
  rescue
7049
-
7057
+ begin
7058
+ @driver.find_element(:id, 'userPw').send_keys(user_pw)
7059
+ sleep(1)
7060
+ puts '-[√] 패스워드 22코드 타겟.......'.yellow
7061
+ rescue
7062
+
7063
+ end
7050
7064
  end
7051
7065
  end
7052
7066
  end
@@ -7071,7 +7085,7 @@ begin
7071
7085
  sleep(1)
7072
7086
  end
7073
7087
  ##<─────────────────────────────────────────────────────────────────────패스워드 입력 코드 부분
7074
-
7088
+
7075
7089
  ##패스워드 입력 2차 코드 부분─────────────────────────────────────────────────────────────────────>
7076
7090
  begin
7077
7091
  @driver.find_element(:xpath, '//*[@for="blogPostPassword2"]').send_keys(user_pw)
@@ -8240,12 +8254,22 @@ end
8240
8254
  @driver.find_element(:xpath, '//*[@id="wr_content-html"]').click
8241
8255
  rescue
8242
8256
  begin
8243
-
8244
- html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label')
8245
- @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8246
- puts '-[√] HTML 코드 28 code.......'.yellow
8247
- sleep(1)
8248
- @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
8257
+
8258
+ html_bb = @driver.find_element(xpath: '//*[@id="fwrite"]/div[2]/ul/li/label')
8259
+
8260
+ # 텍스트 확인
8261
+ if html_bb.text.include?("비밀글")
8262
+ puts "비밀글 항목이므로 클릭하지 않음"
8263
+ raise #턴 넘김
8264
+ else
8265
+ html_bb = @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label')
8266
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8267
+ sleep(1)
8268
+ @driver.find_element(:xpath, '//*[@id="fwrite"]/div[2]/ul/li/label').click
8269
+ sleep(1)
8270
+ puts '-[√] HTML 코드 28 code.......'.yellow
8271
+ end
8272
+
8249
8273
  rescue
8250
8274
  begin
8251
8275
  @driver.switch_to.frame(@driver.find_element(:xpath, '//*[@id="NamoSE_Ifr__editor"]'))
@@ -8260,7 +8284,7 @@ end
8260
8284
  @driver.switch_to.default_content()
8261
8285
  html_bb = @driver.find_element(:xpath, '//*[@type="radio" and @name="rg_html_use" and @value="1"]')
8262
8286
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8263
- puts '-[√] HTML 코드 28 code.......'.yellow
8287
+ puts '-[√] HTML 코드 30 code.......'.yellow
8264
8288
  sleep(1)
8265
8289
  @driver.find_element(:xpath, '//*[@type="radio" and @name="rg_html_use" and @value="1"]').click
8266
8290
  rescue
@@ -8274,7 +8298,7 @@ end
8274
8298
  sleep(1)
8275
8299
  @driver.find_element(:xpath, '//*[@title="HTML 편집기"]').click
8276
8300
  @driver.switch_to.default_content()
8277
- puts '-[√] HTML 코드 29 code.......'.yellow
8301
+ puts '-[√] HTML 코드 31 code.......'.yellow
8278
8302
  sleep(1)
8279
8303
  rescue
8280
8304
  begin
@@ -8284,7 +8308,7 @@ end
8284
8308
  #아이프레임 나오기
8285
8309
  sleep(1)
8286
8310
  @driver.find_element(:xpath, '//*[@type="checkbox" and @name="ctype" and @value="H"]').click
8287
- puts '-[√] HTML 코드 30 code.......'.yellow
8311
+ puts '-[√] HTML 코드 32 code.......'.yellow
8288
8312
  sleep(1)
8289
8313
  rescue
8290
8314
  begin
@@ -8295,7 +8319,7 @@ end
8295
8319
  html_bb = @driver.find_element(:xpath, '//*[@class="combobox_mode"]').click
8296
8320
  sleep(1.5)
8297
8321
  html_bb = @driver.find_element(:xpath, '//*[@key="Html"]').click
8298
- puts '-[√] HTML 코드 31 code.......'.yellow
8322
+ puts '-[√] HTML 코드 33 code.......'.yellow
8299
8323
  sleep(1)
8300
8324
  rescue
8301
8325
  begin
@@ -8303,7 +8327,7 @@ end
8303
8327
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8304
8328
  sleep(1)
8305
8329
  html_bb = @driver.find_element(:xpath, '//*[@name="use_html"]').click
8306
- puts '-[√] HTML 코드 32 code.......'.yellow
8330
+ puts '-[√] HTML 코드 34 code.......'.yellow
8307
8331
  sleep(1)
8308
8332
  rescue
8309
8333
  begin
@@ -8311,7 +8335,7 @@ end
8311
8335
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8312
8336
  sleep(1)
8313
8337
  html_bb = @driver.find_element(:xpath, '//*[@class="note-btn btn-codeview note-codeview-keep"]').click
8314
- puts '-[√] HTML 코드 32 code.......'.yellow
8338
+ puts '-[√] HTML 코드 35 code.......'.yellow
8315
8339
  sleep(1)
8316
8340
  rescue
8317
8341
  begin
@@ -8324,7 +8348,7 @@ end
8324
8348
  sleep(1)
8325
8349
  @driver.find_element(:xpath, '//*[@data-button-id="html"]').click
8326
8350
  @driver.switch_to.default_content
8327
- puts '-[√] HTML 코드 33 code.......'.yellow
8351
+ puts '-[√] HTML 코드 36 code.......'.yellow
8328
8352
  sleep(1)
8329
8353
  rescue
8330
8354
  begin
@@ -8333,39 +8357,49 @@ end
8333
8357
  @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8334
8358
  sleep(1)
8335
8359
  html_bb = @driver.find_element(xpath: '//a[@href="#htmlEditor" and contains(@onclick, "html")]').click
8336
- puts '-[√] HTML 코드 34 code.......'.yellow
8360
+ puts '-[√] HTML 코드 37 code.......'.yellow
8337
8361
  sleep(1)
8338
8362
  rescue
8339
8363
  begin
8340
8364
  @driver.switch_to.default_content
8341
- if target_element
8342
- # 3. 제목 요소 바로 아래에 체크박스 HTML 삽입
8343
- checkbox_html = <<~HTML
8344
- <div class="custom-control custom-checkbox custom-control-inline">
8345
- <input type="checkbox" name="html" value="html2" id="html" onclick="html_auto_br(this);" class="custom-control-input">
8346
- <label class="custom-control-label" for="html"><span>HTML</span></label>
8347
- </div>
8348
- HTML
8349
- @driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
8350
- puts '체크박스 HTML 강제 적용.......'.green
8351
- sleep(1)
8352
-
8353
- # 4. 삽입한 체크박스 스크롤하여 화면 중앙으로 이동
8354
- html_checkbox = @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]')
8355
- @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
8356
- sleep(1)
8357
-
8358
- # 5. HTML 토글 버튼 클릭
8359
- @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
8360
- puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
8365
+ html_bb = @driver.find_element(xpath: '//input[@type="checkbox" and @name="chkhtml"]')
8366
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_bb)
8367
+ sleep(1)
8368
+ html_bb = @driver.find_element(xpath: '//input[@type="checkbox" and @name="chkhtml"]').click
8369
+ puts '-[√] HTML 코드 38 code.......'.yellow
8361
8370
  sleep(1)
8362
-
8363
- else
8364
- puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
8365
- end
8366
8371
  rescue
8367
-
8368
- end
8372
+ begin
8373
+ @driver.switch_to.default_content
8374
+ if target_element
8375
+ # 3. 제목 요소 바로 아래에 체크박스 HTML 삽입
8376
+ checkbox_html = <<~HTML
8377
+ <div class="custom-control custom-checkbox custom-control-inline">
8378
+ <input type="checkbox" name="html" value="html2" id="html" onclick="html_auto_br(this);" class="custom-control-input">
8379
+ <label class="custom-control-label" for="html"><span>HTML</span></label>
8380
+ </div>
8381
+ HTML
8382
+ @driver.execute_script("arguments[0].insertAdjacentHTML('afterend', arguments[1]);", target_element, checkbox_html)
8383
+ puts '체크박스 HTML 강제 적용.......'.green
8384
+ sleep(1)
8385
+
8386
+ # 4. 삽입한 체크박스 스크롤하여 화면 중앙으로 이동
8387
+ html_checkbox = @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]')
8388
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", html_checkbox)
8389
+ sleep(1)
8390
+
8391
+ # 5. HTML 토글 버튼 클릭
8392
+ @driver.find_element(:xpath, '//*[@type="checkbox" and @name="html"]').click
8393
+ puts '-[√] 임의 추가 HTML 코드 01 code.......'.yellow
8394
+ sleep(1)
8395
+
8396
+ else
8397
+ puts "타겟 제목 요소가 없어서 체크박스 삽입 불가".red
8398
+ end
8399
+ rescue
8400
+
8401
+ end
8402
+ end
8369
8403
  end
8370
8404
  end
8371
8405
  end
@@ -12380,6 +12414,35 @@ ss_button = @driver.find_element(xpath: '//span[@class="button"]/input[@type="su
12380
12414
  puts '-[√] 등록을 52번 코드로 시도하였습니다.......'.magenta
12381
12415
  sleep(1)
12382
12416
 
12417
+ rescue
12418
+ begin
12419
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "btn_insert") and contains(normalize-space(.), "등록")]')
12420
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12421
+ sleep(1)
12422
+
12423
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "btn_insert") and contains(normalize-space(.), "등록")]').click
12424
+ puts '-[√] 등록을 53번 코드로 시도하였습니다.......'.magenta
12425
+ sleep(1)
12426
+
12427
+ rescue
12428
+ begin
12429
+ ss_button = @driver.find_element(xpath: '//img[contains(@src, "btn_write.gif")]')
12430
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12431
+ sleep(1)
12432
+
12433
+ ss_button = @driver.find_element(xpath: '//img[contains(@src, "btn_write.gif")]').click
12434
+ puts '-[√] 등록을 54번 코드로 시도하였습니다.......'.magenta
12435
+ sleep(1)
12436
+ '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]'
12437
+ rescue
12438
+ begin
12439
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]')
12440
+ @driver.execute_script("arguments[0].scrollIntoView({block: 'center', inline: 'center'})", ss_button)
12441
+ sleep(1)
12442
+
12443
+ ss_button = @driver.find_element(xpath: '//button[@type="submit" and contains(@class, "kboard-default-button-small") and contains(text(), "저장하기")]').click
12444
+ puts '-[√] 등록을 55번 코드로 시도하였습니다.......'.magenta
12445
+ sleep(1)
12383
12446
 
12384
12447
  rescue
12385
12448
  ########─────────────────────────────▼▼▼▼▼▼▼ 등록버튼 2차 시도 ▼▼▼▼▼▼▼──────────────────────────────#######
@@ -12571,6 +12634,7 @@ end
12571
12634
  end
12572
12635
  end
12573
12636
  end
12637
+ end
12574
12638
  end
12575
12639
  end
12576
12640
  end
@@ -12591,6 +12655,8 @@ end
12591
12655
  end
12592
12656
  end
12593
12657
  end
12658
+ end
12659
+ end
12594
12660
  end
12595
12661
  ########─────────────────────────────▲▲▲▲▲▲▲ 등록버튼 2차 시도 ▲▲▲▲▲▲▲──────────────────────────────#######
12596
12662
  end
@@ -13222,6 +13288,7 @@ class Wordpress
13222
13288
  end
13223
13289
 
13224
13290
 
13291
+
13225
13292
  def color_image
13226
13293
  color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
13227
13294
  image = Magick::Image.new(740, 740) { |k| k.background_color = color.sample }
@@ -13230,187 +13297,79 @@ class Wordpress
13230
13297
 
13231
13298
  def save_image
13232
13299
  if @data['이미지설정']['이미지'].length == 0
13233
- return
13234
- end
13235
-
13236
- if @data['이미지설정']['순서사용'].checked?
13237
- image_path = @data['이미지설정']['이미지'][@image_counter][2]
13238
- @image_counter += 1
13239
- if @image_counter > @data['이미지설정']['이미지'].length - 1
13240
- @image_counter = 0
13241
- end
13300
+
13242
13301
  else
13243
- # 초기화가 안됐거나 다 썼으면 새롭게 섞는다
13244
- @shuffled_images ||= []
13245
- if @shuffled_images.empty?
13246
- @shuffled_images = @data['이미지설정']['이미지'].shuffle
13302
+ if @data['이미지설정']['순서사용'].checked?
13303
+ image_path = @data['이미지설정']['이미지'][@image_counter][2]
13304
+ @image_counter += 1
13305
+ if @image_counter > @data['이미지설정']['이미지'].length-1
13306
+ @image_counter = 0
13307
+ end
13308
+ else
13309
+ image_path = @data['이미지설정']['이미지'].sample[2]
13247
13310
  end
13248
-
13249
- image_path = @shuffled_images.shift[2]
13311
+ img = Magick::Image.read(image_path).first
13312
+ img.write('./image/memory.png')
13250
13313
  end
13251
-
13252
- img = Magick::Image.read(image_path).first
13253
- img.write('./image/memory.png')
13254
13314
  end
13255
13315
 
13256
13316
  def change_image_size(w)
13257
13317
  img = Magick::Image.read('./image/memory.png').first
13258
13318
  width = img.columns
13259
13319
  height = img.rows
13260
-
13261
- # '원본' 선택된 경우, 리사이징을 하지 않고 원본 이미지를 그대로 반환
13262
- if w == 'original'
13263
- return img # 원본 이미지 그대로 반환
13264
- else
13265
- begin
13266
- if @data['image_type'][0].checked? or @data['image_type'][2].checked?
13267
- # 비율을 맞추어 리사이징
13268
- img.resize!(w, w * (height.to_f / width.to_f))
13269
- else
13270
- # 정사각형으로 리사이징
13271
- img.resize!(w, w)
13272
- end
13273
- rescue
13274
- img.resize!(w, w) # 예외 처리 시에도 리사이징
13320
+ begin
13321
+ if @data['image_type'][0].checked? or @data['image_type'][2].checked?
13322
+ img.resize!(w, w*(height.to_f/width.to_f))
13323
+ else
13324
+ img.resize!(w, w)
13275
13325
  end
13326
+ rescue
13327
+ img.resize!(w, w)
13276
13328
  end
13277
-
13278
- # 리사이징된 이미지 저장
13279
13329
  img.write('./image/memory.png')
13280
13330
  end
13281
13331
 
13282
- def wrap_text_to_fit(draw, text, max_width, max_height, font_path, initial_size)
13283
- size = initial_size
13284
- draw.font = font_path
13285
-
13286
- loop do
13287
- draw.pointsize = size
13288
- words = text.chars # 글자 단위로 자름 (한국어 기준)
13289
- lines = []
13290
- line = ""
13291
-
13292
- words.each do |char|
13293
- test_line = line + char
13294
- metrics = draw.get_type_metrics(test_line)
13295
- if metrics.width > max_width
13296
- lines << line
13297
- line = char
13298
- else
13299
- line = test_line
13300
- end
13332
+ def image_text(text1, text2)
13333
+ begin
13334
+ color = File.open('./color.ini', 'r', :encoding => 'utf-8').read().split("\n")
13335
+ font = Dir.entries('./fonts')
13336
+ img = Magick::Image.read('./image/memory.png').first
13337
+ text = Magick::Draw.new
13338
+ color2 = color.sample
13339
+ font2 = './fonts/'+font.sample
13340
+ message = text1.to_s+"\n"+text2.to_s
13341
+ begin
13342
+ size = rand(@data['이미지설정']['이미지글자1크기1'].text.to_i..@data['이미지설정']['이미지글자1크기2'].text.to_i)
13343
+ rescue
13344
+ size = 30
13301
13345
  end
13302
- lines << line unless line.empty?
13303
-
13304
- line_height = draw.get_type_metrics("가").height
13305
- total_height = line_height * lines.size
13306
-
13307
- # 세로 초과 안 하면 성공
13308
- if total_height <= max_height || size <= 10
13309
- return [lines.join("\n"), size]
13310
- else
13311
- size -= 2
13346
+ if @data['이미지설정']['글자그림자'].checked?
13347
+ img.annotate(text, 0,0, +3,+3, message) do
13348
+ text.gravity = Magick::CenterGravity
13349
+ text.pointsize = size
13350
+ text.fill = '#000000'
13351
+ text.font = font2
13352
+ end
13312
13353
  end
13313
- end
13314
- end
13315
-
13316
-
13317
- def image_text(text1, text2)
13318
- begin
13319
- color = File.open('./color.ini', 'r', encoding: 'utf-8').read.split("\n").map(&:strip).reject(&:empty?)
13320
- font_files = Dir.entries('./fonts').select { |f| f.downcase.end_with?('.ttf') }
13321
- font2 = './fonts/' + font_files.sample
13322
-
13323
- # 랜덤 글자색 선택
13324
- color2 = color.sample
13325
-
13326
- # 헬퍼 함수: 색상 문자열 '#RRGGBB' -> [R,G,B] 배열로 변환
13327
- def hex_to_rgb(hex)
13328
- hex = hex.delete('#')
13329
- [hex[0..1], hex[2..3], hex[4..5]].map { |c| c.to_i(16) }
13330
- end
13331
-
13332
- # 헬퍼 함수: 두 RGB 색상의 차이 계산 (간단한 유클리드 거리)
13333
- def color_distance(c1, c2)
13334
- Math.sqrt(
13335
- (c1[0] - c2[0])**2 +
13336
- (c1[1] - c2[1])**2 +
13337
- (c1[2] - c2[2])**2
13338
- )
13339
- end
13340
-
13341
- # 대비가 충분히 되는 테두리 색상 선택
13342
- max_attempts = 10
13343
- stroke_color = nil
13344
- base_rgb = hex_to_rgb(color2)
13345
-
13346
- max_attempts.times do
13347
- candidate = color.sample
13348
- candidate_rgb = hex_to_rgb(candidate)
13349
- dist = color_distance(base_rgb, candidate_rgb)
13350
-
13351
- # 거리(차이) 임계값 100 (0~441 범위) — 필요시 조절 가능
13352
- if dist > 100
13353
- stroke_color = candidate
13354
- break
13355
- end
13356
- end
13357
- stroke_color ||= '#000000' # 만약 충분히 다른 색 없으면 검정색 기본값
13358
13354
 
13359
- img = Magick::Image.read('./image/memory.png').first
13360
- draw = Magick::Draw.new
13361
-
13362
- raw_message = "#{text1}\n#{text2}".strip
13363
- max_width = img.columns * 0.85
13364
- max_height = img.rows * 0.6
13355
+ img.annotate(text, 0,0,0,0, message) do
13356
+ text.gravity = Magick::CenterGravity
13357
+ text.pointsize = size
13358
+ if @data['이미지설정']['글자테두리'].checked?
13359
+ text.stroke_width = 2
13360
+ text.stroke = '#000000'
13361
+ end
13362
+ text.fill = color2
13363
+ text.font = font2
13364
+ end
13365
13365
 
13366
- begin
13367
- size = rand(@data['이미지설정']['이미지글자1크기1'].text.to_i..@data['이미지설정']['이미지글자1크기2'].text.to_i)
13366
+ img.write('./image/memory.png')
13368
13367
  rescue
13369
- size = 30
13370
- end
13371
-
13372
- wrapped_message, adjusted_size = wrap_text_to_fit(draw, raw_message, max_width, max_height, font2, size)
13373
-
13374
- if @data['이미지설정']['글자그림자'].checked?
13375
- img.annotate(draw, 0, 0, 2, 2, wrapped_message) do
13376
- draw.gravity = Magick::CenterGravity
13377
- draw.pointsize = adjusted_size
13378
- draw.fill = '#000000'
13379
- draw.font = font2
13380
- end
13381
- end
13382
-
13383
- if @data['이미지설정']['글자테두리'].checked?
13384
- draw_stroke = Magick::Draw.new
13385
- img.annotate(draw_stroke, 0, 0, 0, 0, wrapped_message) do
13386
- draw_stroke.gravity = Magick::CenterGravity
13387
- draw_stroke.pointsize = adjusted_size
13388
- draw_stroke.fill = 'none'
13389
- draw_stroke.stroke = stroke_color
13390
- draw_stroke.stroke_width = rand(5..10)
13391
- draw_stroke.font = font2
13392
- end
13393
- end
13394
-
13395
- draw2 = Magick::Draw.new
13396
- img.annotate(draw2, 0, 0, 0, 0, wrapped_message) do
13397
- draw2.gravity = Magick::CenterGravity
13398
- draw2.pointsize = adjusted_size
13399
- draw2.fill = color2
13400
- draw2.stroke = 'none'
13401
- draw2.font = font2
13368
+ puts '이미지 폰트 불러오기 오류 재시도...'
13369
+ sleep(3)
13370
+ retry
13402
13371
  end
13403
-
13404
- img.write('./image/memory.png')
13405
-
13406
- rescue => e
13407
- puts "이미지 폰트 불러오기 오류 재시도... (#{e.message})"
13408
- sleep(3)
13409
- retry
13410
13372
  end
13411
- end
13412
-
13413
-
13414
13373
 
13415
13374
  def border()
13416
13375
  color = File.open('./color.ini', 'r',:encoding => 'utf-8').read().split("\n")
@@ -13437,69 +13396,40 @@ class Wordpress
13437
13396
  else
13438
13397
  auto_image()
13439
13398
  end
13440
-
13441
- # '원본'을 포함한 이미지 크기 옵션 추가
13442
- image_size = [480, 740, 650, 550, 480, 'original']
13399
+
13400
+ image_size = [480,740,650,550,480]
13443
13401
  size = 0
13444
-
13445
- for n in 0..5 # 0부터 5까지 반복, '원본' 옵션까지 포함
13402
+ for n in 0..4
13446
13403
  if @data['image_size'][n].checked?
13447
- if n == 5 # '원본'이 선택되었을 경우
13448
- size = 'original'
13449
- elsif n == 0
13450
- size = image_size.sample # 랜덤 선택
13404
+ if n == 0
13405
+ size = image_size.sample
13451
13406
  else
13452
13407
  size = image_size[n]
13453
13408
  end
13454
13409
  end
13455
13410
  end
13456
-
13457
- # '원본'이 선택되지 않았다면 기본 값 설정
13458
13411
  if size == 0
13459
13412
  size = 480
13460
13413
  end
13461
-
13462
- change_image_size(size) # 크기 변경 함수 호출
13463
13414
 
13415
+ change_image_size(size)
13464
13416
 
13465
13417
  if @data['이미지설정']['필터사용'].checked?
13466
13418
  image_filter()
13467
13419
  end
13468
13420
 
13421
+ insert_image_text1 = ''
13422
+ insert_image_text2 = ''
13469
13423
  if @data['이미지설정']['글자삽입1'].checked?
13470
- if @data['이미지설정']['이미지글자1'].length == 0
13471
- image_text_path1 = ''
13472
- else
13473
- if @data['이미지설정']['글자랜덤'].checked?
13474
- image_text_path1 = @data['이미지설정']['이미지글자1'].sample
13475
- else
13476
- image_text_path1 = @data['이미지설정']['이미지글자1'][@image_text_soon1]
13477
- @image_text_soon1 += 1
13478
- if @image_text_soon1 > @data['이미지설정']['이미지글자1'].length - 1
13479
- @image_text_soon1 = 0
13480
- end
13481
- end
13482
- end
13424
+ insert_image_text1 = @data['이미지설정']['이미지글자1'].sample
13483
13425
  end
13484
13426
 
13485
13427
  if @data['이미지설정']['글자삽입2'].checked?
13486
- if @data['이미지설정']['이미지글자2'].length == 0
13487
- image_text_path2 = ''
13488
- else
13489
- if @data['이미지설정']['글자랜덤'].checked?
13490
- image_text_path2 = @data['이미지설정']['이미지글자2'].sample
13491
- else
13492
- image_text_path2 = @data['이미지설정']['이미지글자2'][@image_text_soon2]
13493
- @image_text_soon2 += 1
13494
- if @image_text_soon2 > @data['이미지설정']['이미지글자2'].length - 1
13495
- @image_text_soon2 = 0
13496
- end
13497
- end
13498
- end
13428
+ insert_image_text2 = @data['이미지설정']['이미지글자2'].sample
13499
13429
  end
13500
-
13430
+
13501
13431
  if @data['이미지설정']['글자삽입1'].checked? or @data['이미지설정']['글자삽입2'].checked?
13502
- image_text(image_text_path1, image_text_path2)
13432
+ image_text(insert_image_text1, insert_image_text2)
13503
13433
  end
13504
13434
 
13505
13435
  if @data['이미지설정']['테두리사용'].checked?
@@ -15355,13 +15285,12 @@ class Wordpress
15355
15285
  horizontal_box{
15356
15286
  stretchy false
15357
15287
  @data['image_size'][0] = checkbox('랜덤 px'){
15358
- on_toggled{
15288
+ on_toggled{
15359
15289
  if @data['image_size'][0].checked?
15360
15290
  @data['image_size'][1].checked = false
15361
15291
  @data['image_size'][2].checked = false
15362
15292
  @data['image_size'][3].checked = false
15363
15293
  @data['image_size'][4].checked = false
15364
- @data['image_size'][5].checked = false
15365
15294
  end
15366
15295
  }
15367
15296
  }
@@ -15372,7 +15301,6 @@ class Wordpress
15372
15301
  @data['image_size'][2].checked = false
15373
15302
  @data['image_size'][3].checked = false
15374
15303
  @data['image_size'][4].checked = false
15375
- @data['image_size'][5].checked = false
15376
15304
  end
15377
15305
  }
15378
15306
  }
@@ -15383,7 +15311,6 @@ class Wordpress
15383
15311
  @data['image_size'][0].checked = false
15384
15312
  @data['image_size'][3].checked = false
15385
15313
  @data['image_size'][4].checked = false
15386
- @data['image_size'][5].checked = false
15387
15314
  end
15388
15315
  }
15389
15316
  }
@@ -15394,7 +15321,6 @@ class Wordpress
15394
15321
  @data['image_size'][2].checked = false
15395
15322
  @data['image_size'][0].checked = false
15396
15323
  @data['image_size'][4].checked = false
15397
- @data['image_size'][5].checked = false
15398
15324
  end
15399
15325
  }
15400
15326
  }
@@ -15405,21 +15331,10 @@ class Wordpress
15405
15331
  @data['image_size'][2].checked = false
15406
15332
  @data['image_size'][3].checked = false
15407
15333
  @data['image_size'][0].checked = false
15408
- @data['image_size'][5].checked = false
15409
- end
15410
- }
15411
- }
15412
- @data['image_size'][5] = checkbox('원본 px'){
15413
- on_toggled{
15414
- if @data['image_size'][5].checked?
15415
- @data['image_size'][1].checked = false
15416
- @data['image_size'][2].checked = false
15417
- @data['image_size'][3].checked = false
15418
- @data['image_size'][0].checked = false
15419
- @data['image_size'][4].checked = false
15420
15334
  end
15421
15335
  }
15422
15336
  }
15337
+
15423
15338
  }
15424
15339
  }
15425
15340
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posting_zon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.111.010
4
+ version: 3.111.013
5
5
  platform: ruby
6
6
  authors:
7
7
  - zon
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-06-27 00:00:00.000000000 Z
10
+ date: 2025-07-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: posting app
13
13
  email: mymin26@naver.com